Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

pokeyman posted:

Beat you by over an hour!

On the other hand, it's been an awful quiet chatroom since I joined...

Adbot
ADBOT LOVES YOU

Doctor w-rw-rw-
Jun 24, 2008

Axiem posted:

On the other hand, it's been an awful quiet chatroom since I joined...

I was only there during work hours pacific time, then left to get dinner and stuff.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Axiem posted:

On the other hand, it's been an awful quiet chatroom since I joined...

Then start chating! I'm on throughout the workday (EST) and I'll be there at night if I'm not busy doing other important things (video games, eating, in that order).

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost
I wonder if you guys could help me out on this. I posted a question over on SO: http://stackoverflow.com/questions/18602332/where-is-this-vertical-spacing-coming-from-in-uilabelview but I'm not getting much on it. I figured there'd be about a 95% chance the response would be "your constraints are probably wrong" when I'm almost certain that's not true and frankly it's easier here to expound upon further details if people need them.

The main thing I'm getting at is why the gently caress does the UILabel behave in this particular way in the iPad layout? This may be an A/B problem but I'm convinced that's where things are going sideways.

LP0 ON FIRE
Jan 25, 2006

beep boop
I literally just had an unassigned bool evaluate as YES over and over again no matter what I did. I finally just wrote out that it equals NO when I defined it.

I had no idea that this could happen, and when you define a bool it would equal NO by default, but I guess not?

Doc Block
Apr 15, 2003
Fun Shoe
If it's local to the function/method then no, its initial value will be whatever happened to previously occupy that same memory location.

If it's an instance method, then yeah, its initial value should be NO. Something else has to be setting it to YES somewhere, so set a breakpoint on it and find out what.

edit: for clarity:
Objective-C code:
@implementation MyGreatClass {
    BOOL safeBool;        // is allocated on the heap as part of each MyGreatClass instance, and gets set with an initial value of NO
}

- (void)myGreatMethod
{
    BOOL wildBool;        // is allocated on the stack, and the memory for it is not cleared first so the initial value will be whatever previously occupied that same memory location.
    if(wildBool) {
        // wildBool could be anything
    }
}

Doc Block fucked around with this message at 06:19 on Sep 5, 2013

LP0 ON FIRE
Jan 25, 2006

beep boop
Thanks, it was the first thing you mentioned. (is allocated on the stack and the initial value will be whatever previously occupied that same memory location)

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

LP0 ON FIRE posted:

Thanks, it was the first thing you mentioned. (is allocated on the stack and the initial value will be whatever previously occupied that same memory location)

This is actually something the static analyzer will check. If you choose "Analyze" in the build menu it should show an analyzer warning about the boolean being uninitialized and potentially garbage.

Edit: and it looks like XCode 5 catches it as a vanilla warning at build time, which is pretty nice.

ultramiraculous fucked around with this message at 10:22 on Sep 5, 2013

lord funk
Feb 16, 2004

File management makes me want to die. Not that it's badly implemented or anything, it's just so booooooring and tedious.

Toady
Jan 12, 2009

LP0 ON FIRE posted:

Thanks, it was the first thing you mentioned. (is allocated on the stack and the initial value will be whatever previously occupied that same memory location)

Enable the warning for uninitialized variables in your build settings.

LP0 ON FIRE
Jan 25, 2006

beep boop

ultramiraculous posted:

This is actually something the static analyzer will check. If you choose "Analyze" in the build menu it should show an analyzer warning about the boolean being uninitialized and potentially garbage.

Edit: and it looks like XCode 5 catches it as a vanilla warning at build time, which is pretty nice.

Xcode 4.6 does too at my work. But I have the same Xcode at home I think?? Weird.


Toady posted:

Enable the warning for uninitialized variables in your build settings.

I'd rather it just show the warning like it does in my project at work. I haven't tested it in ARC here, but that's the only difference I can think of.

Toady
Jan 12, 2009

LP0 ON FIRE posted:

I'd rather it just show the warning like it does in my project at work. I haven't tested it in ARC here, but that's the only difference I can think of.

I must not be understanding you. Xcode 4.6 will display an inline warning and a Fix-It, often right after you type the offending code. The warning can be enabled in build settings (-Wuninitialized).

lord funk
Feb 16, 2004

How do you close a UIDocument without saving it? Am I correct that you just don't call -closeWithCompletionHandler?

Related: this is my current plan to duplicate an open document into a new document, and leave the original file untouched:

1. Duplicate the open document's file (does not have saved changes) into a temporary directory
2. -saveToURL:forSaveOperation:completionHandler with the new document URL ("DocName Copy" or something) into the Documents folder
3. Move the duplicated file into the Documents folder

Does that sound right? I was surprised that -saveToURL:forSaveOperation:completionHandler removes the file behind it if you save to a new URL.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

LP0 ON FIRE posted:

Thanks, it was the first thing you mentioned. (is allocated on the stack and the initial value will be whatever previously occupied that same memory location)

Also a good reason you should use calloc if you are doing any C stuff; it zeros out the memory as opposed to malloc leaving whatever garbage laying about.

Fun fact: fools often claim that malloc is faster but in fact on most platforms calloc uses VMM optimization tricks that make it almost the same speed or even faster. On Apple platforms and Windows, it just allocates virtual address space. On Windows, it goes further... The reads all happen from the same zero page with copy on write semantics, and the system scrubs free'd pages in the background to keep a pool of zero'd out pages ready when you attempt the first write. Not sure if Apple platforms go that far, but I know they don't bother actually allocating the pages and zeroing them out until you use them.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Ender.uNF posted:

Also a good reason you should use calloc if you are doing any C stuff; it zeros out the memory as opposed to malloc leaving whatever garbage laying about.

Fun fact: fools often claim that malloc is faster but in fact on most platforms calloc uses VMM optimization tricks that make it almost the same speed or even faster. On Apple platforms and Windows, it just allocates virtual address space. On Windows, it goes further... The reads all happen from the same zero page with copy on write semantics, and the system scrubs free'd pages in the background to keep a pool of zero'd out pages ready when you attempt the first write. Not sure if Apple platforms go that far, but I know they don't bother actually allocating the pages and zeroing them out until you use them.

One thing I didn't know until I ran into it in practice, is iOS devices will zero larger mallocs but the simulator will not/did not as of around two years ago. It's basically for the VMM optimizations you're talking about, based on what Apple is saying. We basically had a bug for a short time where some image processing was showing up corrupted in the simulator and fine in device, because a malloc was used and some part of the image data wasn't overwritten.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Ender.uNF posted:

Fun fact: fools often claim that malloc is faster but in fact on most platforms calloc uses VMM optimization tricks that make it almost the same speed or even faster. On Apple platforms and Windows, it just allocates virtual address space.

I highly doubt that, virtual address space comes in 4KB or larger chunks, which can be a lot of overhead. I know for a fact that Windows will only do that for large allocations, or if the page heap is being used (a heap implementation that places all allocations at the end of a page, followed by an inaccessible page. It turns heap block overflows into segmentation faults making them super-easy to debug)

malloc is undeniably faster than calloc (zeroing out the allocation not only takes time, it also may thrash the cache), but it hardly matters

lord funk
Feb 16, 2004

From the why-can't-it-just-work department: my MFMailComposerViewController is FUBAR.

No keyboard appears (except flashing when you hit Cancel), the layout is messed up (and I didn't block the email address - that actually appears that way):


What it should look like:


If you leave the app and return, the keyboard is suddenly there. But if you hide it, it's gone forever again. The same code in its own project works fine. What switch did I flip to mess everything up? I know it's not a lot to go on, but any clues?

lord funk
Feb 16, 2004

Now with the thrill of video!

https://www.youtube.com/watch?v=6kp9_SSITeY

bumnuts
Dec 10, 2004
mmm...crunchy

lord funk posted:

From the why-can't-it-just-work department: my MFMailComposerViewController is FUBAR.

No keyboard appears (except flashing when you hit Cancel), the layout is messed up (and I didn't block the email address - that actually appears that way):


What it should look like:


If you leave the app and return, the keyboard is suddenly there. But if you hide it, it's gone forever again. The same code in its own project works fine. What switch did I flip to mess everything up? I know it's not a lot to go on, but any clues?

Are you presenting it from a background thread?

lord funk
Feb 16, 2004

bumnuts posted:

Are you presenting it from a background thread?

No, main thread.

Edit fixed: ready for this? In iOS 7 beta 6 using drawViewHierarchy:afterScreenUpdates:YES randomly breaks layout and animations from that point forward. Thanks to someone on the apple dev forums for that, otherwise I never would have found it.

lord funk fucked around with this message at 22:39 on Sep 8, 2013

Doc Block
Apr 15, 2003
Fun Shoe
A disturbing amount of things in iOS 7 are still hilariously broken, especially on iPad. If it's any consolation, MFMailComposeViewController works fine on iPhone.

lord funk
Feb 16, 2004

Doc Block posted:

A disturbing amount of things in iOS 7 are still hilariously broken, especially on iPad.

Nah, seems fine to me:


(Not taken during an animation, it just likes it that way.)

Doc Block
Apr 15, 2003
Fun Shoe
Also, I hate the stupid "every view controller has to set its own tint color and status bar appearance" thing. Even though you're supposed to be able to set a global tint color, stuff like UIImagePickerController isn't smart enough to use a tint color of its own, which makes the Cancel button unreadable if your app has a light tint color.

And Apple really really REALLY wants every app to have a white background and a status bar with black text. It's really getting on my nerves now that I'm trying to put the finishing touches on my app's iOS 7 UI, because the status bar style keeps getting changed back to default instead of the light style because reasons :iiam:

Hog Obituary
Jun 11, 2006
start the day right
For me, UIImagePickerController (in camera mode) keeps the status bar (it doesn't tell the system to hide it), so on iPad it collides with the "switch to front camera" button. I'm presenting it as a full screen modal view controller. I cannot figure out how to get rid of this status bar. The usual status bar hiding methods don't seem to do anything.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
It wouldn't surprise me if a bunch of that stuff got fixed after merging in some top secret feature(s), so another beta wasn't doable.

My Calendar app icon changes into one from another app. I thought it was random, but today I cracked the code: whenever I open a folder, Calendar immediately takes on the icon of that folder's second app.

Hughlander
May 11, 2005

I got called into work over the weekend because XCode 5/Clang building in release mode breaks a library that we've used (and haven't touched) for the past 3 years. It's going to be a long week.

echobucket
Aug 19, 2004

lord funk posted:

Nah, seems fine to me:


(Not taken during an animation, it just likes it that way.)

I figure we'll get GM of iOS 7 for iPhone/iPod Touch only and then we'll continue on with iOS 7.0.1 betas for iPad.

lord funk
Feb 16, 2004

Doc Block posted:

Also, I hate the stupid "every view controller has to set its own tint color and status bar appearance" thing. Even though you're supposed to be able to set a global tint color, stuff like UIImagePickerController isn't smart enough to use a tint color of its own, which makes the Cancel button unreadable if your app has a light tint color.

1000x thiiiiis. Do you want kind of hell I've been living in? I decided my app's colors would change based on the user chosen performance screen colors.



You have to do soooo much manually that the 'hierarchy' system they set up is basically useless. Plus there are plenty of new problems with tinting, like whether the alpha component does anything, whether tintColor or attributes matter, and of course the multitude of beta bugs (including flying views when the tint color changes!).

quote:

And Apple really really REALLY wants every app to have a white background and a status bar with black text. It's really getting on my nerves now that I'm trying to put the finishing touches on my app's iOS 7 UI, because the status bar style keeps getting changed back to default instead of the light style because reasons :iiam:

What killlls me is that the bar tint color changes based on the background content to try and prevent this, but it never, ever, ever looks good. You get washed out gray colors all the time, and what's the point of changing the background color dynamically if the text / icon color doesn't change aaaaaagggggg.

haveblue
Aug 15, 2005



Toilet Rascal
The entire status bar seems like a terrible hack. We were having a problem where we temporarily hid the status bar for one modal screen, but if you left and re-entered the app at that point it would silently re-layout the entire view navigation stack so that when the status bar was restored it would now overlap the top bar. There was no way to cancel or catch that process so we had to show the status bar while regaining focus and then hide it a moment later just to trick the OS into not doing that.

Doc Block
Apr 15, 2003
Fun Shoe
Yeah, the whole "put stuff under the status bar" thing is really really stupid IMHO.

Honestly, I think Jonny Ive is a great hardware designer but completely out of his league with UI design.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Was iOS6 this wishy washy right before it was released? I'm dreading this :ohdear:

Glimm
Jul 27, 2005

Time is only gonna pass you by

Doc Block posted:

Yeah, the whole "put stuff under the status bar" thing is really really stupid IMHO.

Honestly, I think Jonny Ive is a great hardware designer but completely out of his league with UI design.

I think the look is great, but yeah the execution is horrendous - especially regarding the status bar.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Oh hey it's time for absolutely worthless "here's what to expect from iOS 7" articles: http://thenextweb.com/dd/2013/08/11/5-things-to-know-when-converting-your-app-design-to-ios-7/

LP0 ON FIRE
Jan 25, 2006

beep boop
I'm having a really weird issue in the provisioning portal saying that a provision expired when I know it hasn't. On my iPad it says it expires next year. I have another iPad I'd like to put the provision on, so I was planning to grab it from the portal, but welp.

kitten smoothie
Dec 29, 2001

So in what circumstance would you actually want content under the status bar or tab bar view? It seems to go against what users have been used to since day zero.

I really pondered that hard while adjusting my layout to account for the fact that view bounds include altogether useless space, but I couldn't think of anything.

Doc Block
Apr 15, 2003
Fun Shoe
So the bars can be translucent and look cool when you scroll up. True depth, deference to content, and whatever other BS they're on about.

Oh, your app's UI doesn't use some descendant of UIScrollView? Tough luck.

lord funk
Feb 16, 2004

I get the idea behind it. You can see a bit more of your content (albeit blurred) so the screen should feel bigger.

What bothers me is that they solved the contrast issue (what happens when the background content is extremely light / dark) for one use case, which is when the bar is white. If you want a different color bar, it will inevitably look like crap and be unreadable.

Doc Block posted:

Honestly, I think Jonny Ive is a great hardware designer but completely out of his league with UI design.
I think no one told him that designing a UI is not designing a finished product, it's designing a set of tools.

Hog Obituary
Jun 11, 2006
start the day right

lord funk posted:

What bothers me is that they solved the contrast issue (what happens when the background content is extremely light / dark) for one use case, which is when the bar is white. If you want a different color bar, it will inevitably look like crap and be unreadable.
Well, you can use a gray or black bar too and it looks alright. But lord help you if you want something with a hue.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

lord funk posted:

I think no one told him that designing a UI is not designing a finished product, it's designing a set of tools.

This is probably closest to the truth. There's definitely more than one place where this comes up, where if you're not using the UI elements in a context very similar to how Apple uses them, then things get messy.

Another example is using the UIPicker inline in a table: it's a cool idea, but your table better be white or it's not going to look right because you're not allowed to change the text color.

Adbot
ADBOT LOVES YOU

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
The new UIDatePicker can also go take a flying gently caress. It spills over its bounds considerably, begging the question of "why the gently caress did they give it those bounds in the first place"?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply