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
Sewer Adventure
Aug 25, 2004

wellwhoopdedooo posted:

I don't think that's possible.

http://stackoverflow.com/questions/2703936/nsdictionary-nsarray-nsset-and-efficiency/2705313#2705313

Adbot
ADBOT LOVES YOU

Sewer Adventure
Aug 25, 2004

samiamwork posted:

So I'm an idiot and created an app in iTunes Connect with the wrong App ID. I deleted it before I submitted anything but still it looks like the app name is gone forever. Is this really true? I've got an email out to the only iTunes Connect info I could find but maybe someone here has info. This seems really stupid.

Also, "Contact Us"?! Wow. They might as well just call that page "Do Not Contact Us".

I really hope I don't have to pick a new name. But I probably will, rather than wait forever for a response.

Edit: reading the dev forums it looks like *other* people can use my name but *I* can't? How does that make sense?

It's gone. But who cares? it's an app id, nobody sees it anyway.

Sewer Adventure
Aug 25, 2004

Small White Dragon posted:

Had a discussion with another developer and now I'm curious.

Anyone here do programmatic layouts? If so, where do you your cleanup for loadView?

Yes, what do you mean by cleanup? nil your subview properties in viewDidUnload and in dealloc.

Sewer Adventure
Aug 25, 2004

pokeyman posted:

1. Is there any point to niling out instance variables after releasing them?

Yes because anything that tries to access them after they are released will cause a crash if they are not nil

quote:

2. Can I use accessors (e.g. self.something = nil) instead of releasing directly?

Yes I prefer to do this but it is slightly more computationally intensive because you are calling a method rather than just setting a variable. But this can be good if you are using a custom setter e.g. to add KVO or NSNotification observers.

Sewer Adventure
Aug 25, 2004

lord funk posted:

I cannot find any documentation about this behavior. I've added a UINavigationBar over a keyboard input, with two buttons that act as 'Tab' buttons to get to other textfields.

The problem is: the keyboard autocorrects touches away from the buttons. If you type a number, then (relatively) quickly press the kNext button, it will press Delete instead. And there's another button (kPrev) that simply won't respond until a second or two pause has happened after pressing a key.



HELP. I don't want to throw out this feature from the app, but as it stands it's unusable.

Edit: at one point, I put HUGE buttons quite some distance from the keyboard. It still acted the same way.

Probably won't fix it but you should use a UIToolbar for this and not a UINavigationBar

Sewer Adventure
Aug 25, 2004

PT6A posted:

In case anyone is having trouble with bugs after the iOS 5 upgrade (yes, I'm probably the only lazy jerk that didn't download the iOS 5 beta), both of the problems I've encountered have been related to the order in which methods are called during startup. God knows why they worked on iOS 3 and 4 after I had a careful look at things, but they did, and now they don't.

One thing I noticed is that if you have a viewController's view as a subview, it now automatically calls viewWillDisappear, viewWillAppear &c. rather than you having to manually do it in the parent view controller.

Sewer Adventure
Aug 25, 2004
Here's something I learnt today:
code:
[super class] != [self superclass]
So super is just self that calls methods in the superclass instead? Makes sense I guess.

Sewer Adventure
Aug 25, 2004

rjmccall posted:

If the performance of your data structure is really important, you should see whether you can get away with writing it in Objective-C++ and using an STL data structure instead of NSArray. NSArray has something of a jack-of-all-trades design which is not primarily tuned for efficiency, and if nothing else, doing a message send for every access adds up pretty quickly.

Objective C++ is an abomination, you could just use CoreFoundation arrays if you care about message send overhead. That way you get the added bonus of toll-free bridging.

Sewer Adventure
Aug 25, 2004

rjmccall posted:

I'm not trying to start a holy war about languages here. There are plenty of good reasons to use NSArrays, and most programs are not going to be noticeably limited by their performance. If you find that you are, though, moving to CFArray is not a significant change. CFArrays have the same not-particularly-optimal internal structure as NSArrays, and turning a message-send into a call is an improvement but not a major one. They also both force you to use ObjC/CF objects as the elements of your array, which is either totally fine or a major boxing/unboxing overhead, depending on what you're doing.
Well the reason you cited was "message send overhead".

quote:

Toll-free bridging is not a bonus? I mean, don't get me wrong, it's a good thing that NSArrays and CFArrays are interchangeable, but it's not like it's some crazy feature that makes CFArray totally awesome. It's just the absence of what was previously a serious interoperability problem.

It's something you don't get from C++ arrays. You would have to write a bunch of code to convert your C++ arrays if you wanted to use them with UITableViews, for example, and you'd have to deal with the memory management yourself rather than rely on ARC.

quote:

If you don't need interoperability, and you're comfortable with C++ (which it's okay not to be!), and the performance matters, std::vector really is a significant upgrade.

The performance of ObjC structures is perfectly fine, and there's absolutely no reason you would need anything else. I think the fact that none of the standard iOS apps (all of which perform great) use ObjC++ is a testament to this.

Sewer Adventure
Aug 25, 2004

rjmccall posted:


...which standard iOS apps are you referring to here? Because Safari/WebKit/UIWebView is a mix of ObjC++ and pure C++, and without breaking confidentiality I can tell you that I see a *lot* of ObjC++ code in the wild.


Webkit is legacy code (KHTML) that had been written in C++ from the beginning. So I am referring to everything other than WebKit.

Sewer Adventure fucked around with this message at 04:27 on Nov 18, 2011

Sewer Adventure
Aug 25, 2004

rjmccall posted:

Everyone I know that works on WebKit, including a lot of its technical leadership, would laugh you out of the room for suggesting that their use of C++ is simply a legacy holdover and that they'd be happier if it were written exclusively in Objective-C.

The only reason it is in C++ is because it started in C++. If Apple started a web renderer from scratch it would be in Objective C.

quote:

Defining WebKit out of your sample is silly, because WebKit is one of only a few standard apps that both (1) actually has to work with large amounts of data and (2) cares about the speed of access to them. Stocks could hold its monitored ticker symbols in a linked list and do O(n^3) work on every UI refresh and it would be hardly one user in a million who ever even noticed a slowdown. The size of a typical address book is dwarfed by the number of DOM nodes on google.com. Mail is the only real competitor here, and Mail has serious performance problems with large mailboxes, although I doubt that has anything to do with NSArray.

Google Maps is very performant and is not C++

Sewer Adventure
Aug 25, 2004

rjmccall posted:

Okay, look, I appreciate that you have a lot of loyalty to Objective-C and want to defend it against what you perceive as my unfair slights, but you are not actually contributing anything here besides unsubstantiated claims.

My point is that Objective C++ is bad.

Adbot
ADBOT LOVES YOU

Sewer Adventure
Aug 25, 2004

Toady posted:

FYI: Before you speak so authoritatively on Apple's thought process, you should be aware that you're arguing with someone who works on language implementation.

Thanks I didn't realise that appeal to authority was a valid argument

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