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
Filburt Shellbach
Nov 6, 2007

Apni tackat say tujay aaj mitta juu gaa!
Oh wow that is more than I could have hoped for. Thanks Doc Block!

Adbot
ADBOT LOVES YOU

nah thanks
Jun 18, 2004

Take me out.

Doc Block posted:

I'd better grab Xcode 5 DP3 before the PowerMac G3 running the dev center falls over again.

Speaking of which, I can't figure this out since the Dev forums are down: how the gently caress can I download the iOS 7 documentation? Xcode 5 keeps spitting back that I'm not a registered developer, despite the fact that I am. I assume this has to do with the dev center issues, but given the dev forums are down, and the docs are down, I don't know how the hell I'm meant to get at the documentation to code for iOS 7 here...

nah thanks fucked around with this message at 17:23 on Jul 29, 2013

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

squidgee posted:

Speaking of which, I can't figure this out since the Dev forums are down: how the gently caress can I download the iOS 7 documentation? Xcode 5 keeps spitting back that I'm not a registered developer, despite the fact that I am. I assume this has to do with the dev center issues, but given the dev forums are down, and the docs don't load online, I don't know how the hell I'm meant to get at the documentation to code for iOS 7 here...

Are you a registered developer with the $100 iOS dev center membership? I don't think the beta downloads are available to free accounts.

nah thanks
Jun 18, 2004

Take me out.

pokeyman posted:

Are you a registered developer with the $100 iOS dev center membership? I don't think the beta downloads are available to free accounts.

Yes. Hence how I have Xcode 5 dp3 installed.

The issue is that, when I attempt to download the docs in Xcode via the Downloads section in prefs, it kicks back that I'm not registered. I am. Similarly, in the accounts tab it's just eternally "fetching developer info" on my dev account.

I assume this has to do with the Dev Center issues, but there has to be some sort of workaround here? This is normally something I'd go to the dev forums for but...yeah.

EDIT: I've also tried deleting/re-adding the account several times, a restart, etc. Nada.

EDIT 2: I suspect this has to do with the "XCode Automatic Configuration" still being down according to the status update.

nah thanks fucked around with this message at 17:34 on Jul 29, 2013

Doh004
Apr 22, 2007

Mmmmm Donuts...
I have a UITableView as a subview of one of my UIViewControllers (implenting all the datasource and delegate methods). Is there a selector or some sort of notication that is sent out when the UITableView is completely rendered on screen? Basically, I need to wait until all of the rows are displayed before I run something, but I can't seem to find it. The UITableView is created and rendered after the parent's UIViewController's viewWillAppear etc.

Doc Block
Apr 15, 2003
Fun Shoe

squidgee posted:

Yes. Hence how I have Xcode 5 dp3 installed.

The issue is that, when I attempt to download the docs in Xcode via the Downloads section in prefs, it kicks back that I'm not registered. I am. Similarly, in the accounts tab it's just eternally "fetching developer info" on my dev account.

I assume this has to do with the Dev Center issues, but there has to be some sort of workaround here? This is normally something I'd go to the dev forums for but...yeah.

EDIT: I've also tried deleting/re-adding the account several times, a restart, etc. Nada.

EDIT 2: I suspect this has to do with the "XCode Automatic Configuration" still being down according to the status update.

Yeah, the dev center status page says the pre-release docs are still offline, along with Xcode's automatic profile configuration stuff.

nah thanks
Jun 18, 2004

Take me out.

Doc Block posted:

Yeah, the dev center status page says the pre-release docs are still offline, along with Xcode's automatic profile configuration stuff.

I figured as much. Yargh.

duck monster
Dec 15, 2004

Doctor w-rw-rw- posted:

And this, boys and girls, shows just how miserable of a failure Symbian is.

Believe me, as a former Symbian dev, if Nokia had gotten Python to work as a first class dev language rather than a nifty tinkering gimmick symbian dev would have been an infinitely less miserable proposition than it was.

Well that and "We'll charge you $500 per handset type for every app you *submit* for pre-signing testing, and then good luck finding someone to install your app , fucker!"

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Makes sense, thanks for the detailed info. I'm basically going to settle for keeping NSNumber as nil if it's undefined until I have to manually store it somewhere in a NSDictionary, for example when making an AFNetworking call.

Doc Block
Apr 15, 2003
Fun Shoe
A Core Data question/issue/whatever:

I'm trying to abstract away all my app's Core Data stuff (first time I've used Core Data) into a singleton. Various parts of my app need to create model objects (subclasses of NSManagedObject), use them, and hand them to the singleton for safe keeping, and I've run into a design issue.

It seems I can either
1)make the singleton's managed object context publicly visible so that any part of my app can create model objects as-needed, or
2)have the singleton be a factory for every model object

#1 seems icky in terms of implementation hiding and just generally keeping the rest of my app's code free of Core Data, while #2 seems a lot like Java FactoryFactoryFactory stuff (but means I can keep the managed object context private).

Is there another way? Or am I resigned to having a bunch of -newThingWithName:andOtherStuff: methods in the singleton?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doc Block posted:

A Core Data question/issue/whatever:

I'm trying to abstract away all my app's Core Data stuff (first time I've used Core Data) into a singleton. Various parts of my app need to create model objects (subclasses of NSManagedObject), use them, and hand them to the singleton for safe keeping, and I've run into a design issue.

It seems I can either
1)make the singleton's managed object context publicly visible so that any part of my app can create model objects as-needed, or
2)have the singleton be a factory for every model object

#1 seems icky in terms of implementation hiding and just generally keeping the rest of my app's code free of Core Data, while #2 seems a lot like Java FactoryFactoryFactory stuff (but means I can keep the managed object context private).

Is there another way? Or am I resigned to having a bunch of -newThingWithName:andOtherStuff: methods in the singleton?

Here's what I do:

- Have a singleton NSManagedObjectContext lazily created in a class method, maybe call it +defaultManagedObjectContext.
- In a category on NSManagedObject, add class methods like +insertNew that are implemented using the default managed object context from the above.
- Use a custom class for each entity (set it in your data model) so they can be set up as needed. Optionally, specify your dynamic properties here and add specific conveniences like +[Department insertNewEmployeeWithName:]

The benefit of having a "default context" is you can still create other contexts, make new instances in that context as you'd normally do, then merge them in to the default as needed. Code that needs to do this will have Core Data-specific knowledge, while code that doesn't can remain totally ignorant.

Basically, take a look at what mogenerator outputs, then bolt on the default managed object context.

Doc Block
Apr 15, 2003
Fun Shoe
Forgot to mention that I'm already using mogenerator to generate the model object classes. On further inspection, it looks like mogenerator can make the low-level model classes inherit from a custom NSManagedObject subclass instead of directly from NSManagedObject, so I could put the managed object context singleton stuff there instead of having to write it for every class.

I didn't know you could merge managed object contexts together, though I guess it makes sense that you'd need to do that sometimes.

It's nice that Core Data is as powerful and flexible as it is, but I wish it had a simple(r) use path for apps that just need an easy way to persist a few objects (at most a hundred in my app's case) while still having their relationships and such managed for you. Of course, I probably should've learned Core Data a lot sooner...

Anyway, thanks for the advice. Looks like I should probably just stop and read up on Core Data some more.

Doc Block fucked around with this message at 08:35 on Jul 30, 2013

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doc Block posted:

It's nice that Core Data is as powerful and flexible as it is, but I wish it had a simple(r) use path for apps that just need an easy way to persist a few objects (at most a hundred in my app's case) while still having their relationships and such managed for you. Of course, I probably should've learned Core Data a lot sooner...

It'll work, though I wonder if simply using NSCoding and implementing a little relationship management yourself would be easier. Replicating a bit of NSManagedObject's KVO/KVC magic might be fun too.

quote:

Anyway, thanks for the advice. Looks like I should probably just stop and read up on Core Data some more.

I've found that you really can't read enough about Core Data. Read read read away.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Implementing NSCoding and just saving/loading your entire object graph is very easy, especially if you only have a couple objects and you don't need to do fancy fetches & such.

lord funk
Feb 16, 2004

Navigating to one of my .m files in Xcode DP4 causes it to hang and fill my hard drive. I've tried deleting / re-adding the file, cleaning the build, deleting Xcode's preferences, and it still does it. Anyone know where I can look to see what the issue is?

edit: 'fixed' it. I trashed the file with its header, then made new files with File>>New FIle, quit Xcode, and copied the contents over in TextEdit.

lord funk fucked around with this message at 18:55 on Jul 30, 2013

Doc Block
Apr 15, 2003
Fun Shoe

pokeyman posted:

It'll work, though I wonder if simply using NSCoding and implementing a little relationship management yourself would be easier. Replicating a bit of NSManagedObject's KVO/KVC magic might be fun too.


I've found that you really can't read enough about Core Data. Read read read away.

Yeah, my app already uses NSCoding-compliant model objects and just serializes them out to disk with NSKeyedArchiver, but since I'm doing a major refactor in preparation for iOS 7, including redesigning the data layer, and I figured I'd do it the "right" way this time and use Core Data.

The app does a few fetches, but nothing complicated, and having 100 model objects would be an upper-limit extreme case.

I might just go back to NSCoding, though I don't want to be caught flatfooted if/when I really do need to use Core Data for an app.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
I have an unwashed beginner question. Say I use the ObjC git library to sync down a bunch of stuff do my app, and I want that data to persist. What's the ideal location for that kind of content? I'm not super clear on the app folder structure, so I could use a tip.

/Library/Caches is the one, if I'm understanding correctly based on this?

DreadCthulhu fucked around with this message at 21:29 on Jul 30, 2013

lord funk
Feb 16, 2004

Someone else around here was also working on a high-speed text scroll? I've got mine streaming along now:

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

lord funk posted:

Navigating to one of my .m files in Xcode DP4 causes it to hang and fill my hard drive. I've tried deleting / re-adding the file, cleaning the build, deleting Xcode's preferences, and it still does it. Anyone know where I can look to see what the issue is?

edit: 'fixed' it. I trashed the file with its header, then made new files with File>>New FIle, quit Xcode, and copied the contents over in TextEdit.

If you have a copy of the file(s) in the state in which they filled your drive (in SCM or Time Machine), that sounds like a really important bug to file.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

DreadCthulhu posted:

I have an unwashed beginner question. Say I use the ObjC git library to sync down a bunch of stuff do my app, and I want that data to persist. What's the ideal location for that kind of content? I'm not super clear on the app folder structure, so I could use a tip.

/Library/Caches is the one, if I'm understanding correctly based on this?

Library/Caches can be purged by iOS at any time. If that's unacceptable, put it in Library/Application Support and apply the attribute that prevents backup.

lord funk
Feb 16, 2004

eschaton posted:

If you have a copy of the file(s) in the state in which they filled your drive (in SCM or Time Machine), that sounds like a really important bug to file.

That was the second time it happened (with the same file, no less), so if it does it again I'll see if I can get it to fail in a fresh project and send it in. I've gone bug-report happy ever since watching the 'FILE BUG REPORTS' session video.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

lord funk posted:

That was the second time it happened (with the same file, no less), so if it does it again I'll see if I can get it to fail in a fresh project and send it in. I've gone bug-report happy ever since watching the 'FILE BUG REPORTS' session video.

Which session was this?

Doh004
Apr 22, 2007

Mmmmm Donuts...
I want to hide a UIViewController's backButton when it's in Landscape but not Portrait. self.navigationItem.hidesBackButton=YES/NO only seems to work when it's called in UIViewController view life cycle methods. So I figured I'd put that in viewWillLayoutSubviews, but that doesn't actually change the backButton as I imagine the navigationItem has already drawn all of its contents.

I tried even doing self.navigationItem.backBarButtonItem = nil in the viewWillLayoutSubviews but that still didn't do anything :(

Anyone have any suggestions? This is for a UISplitViewController, and I am already using the delegate methods to add my "menu" button to the detailViewController just fine. Maybe I could throw something in there?

lord funk
Feb 16, 2004

ultramiraculous posted:

Which session was this?

Maximizing Apple Development Resources, 415, 2013

lord funk
Feb 16, 2004

Doh004 posted:

Anyone have any suggestions? This is for a UISplitViewController, and I am already using the delegate methods to add my "menu" button to the detailViewController just fine. Maybe I could throw something in there?
I may be wrong, but I think you have to make the entire items array for your navigation bar, and replace it wholesale:

Objective-C code:
    UINavigationItem *items = [[UINavigationItem alloc] init];
    UILabel *titlelabel = [[UILabel alloc] init];
	//set up title
    [items setTitleView:uplabel];

    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@" "
                                                                       style:UIBarButtonItemStylePlain
                                                                      target:self
                                                                      action:@selector(backButtonPressed:)];
    [items setLeftBarButtonItem:newGroupButton];
    [_navBar setItems:@[items]];

Doh004
Apr 22, 2007

Mmmmm Donuts...

lord funk posted:

I may be wrong, but I think you have to make the entire items array for your navigation bar, and replace it wholesale:

Objective-C code:
    UINavigationItem *items = [[UINavigationItem alloc] init];
    UILabel *titlelabel = [[UILabel alloc] init];
	//set up title
    [items setTitleView:uplabel];

    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@" "
                                                                       style:UIBarButtonItemStylePlain
                                                                      target:self
                                                                      action:@selector(backButtonPressed:)];
    [items setLeftBarButtonItem:newGroupButton];
    [_navBar setItems:@[items]];

Do you mean I should do this in the UIViewController's viewWillLayoutSubviews?

Doh004 fucked around with this message at 21:13 on Jul 31, 2013

Doh004
Apr 22, 2007

Mmmmm Donuts...
I've almost got it, turns out our design was way too involved and didn't make sense so we don't need to do all of that. Thank you for the help.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

lord funk posted:

Maximizing Apple Development Resources, 415, 2013

Oh, cool, I din't know StackShots were a thing:



Might have come in handy once or twice in the past.

lord funk
Feb 16, 2004

lord funk posted:

In other news I'm tired of collection views again. Go home, cell; you are drunk.



I think they fixed this in iOS 7 Beta 4! Yay for fixing things!

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.

ultramiraculous posted:

Oh, cool, I din't know StackShots were a thing:



Might have come in handy once or twice in the past.

Please say this is relatively new and not something I've been missing for years. Either way, this is a life saver.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
What's the recommended approach for integrating an ObjC library I'm working on in a separate repository with an iOS app repository? Do most people handle it with git submodules and careful configuration of the target (in case there are tests and other junk in the library's repo that you don't want to build for the iOS app)? Or do people do a ghetto copy and paste into the target project periodically?

Doctor w-rw-rw-
Jun 24, 2008

DreadCthulhu posted:

What's the recommended approach for integrating an ObjC library I'm working on in a separate repository with an iOS app repository? Do most people handle it with git submodules and careful configuration of the target (in case there are tests and other junk in the library's repo that you don't want to build for the iOS app)? Or do people do a ghetto copy and paste into the target project periodically?

Have you heard of / tried CocoaPods?

Don't do submodules. That way lies pain, and dirtied trees. If you want to track external repos use Git subtrees, if CocoaPods isn't your cup of tea (it isn't for everyone and occasionally makes configuration weirdly hard, but I did use it to radically improve a code base once. It was magical). And remember that workspaces resolve project dependencies automatically and implicitly, i.e. without modifying the projects.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

Doctor w-rw-rw- posted:

And remember that workspaces resolve project dependencies automatically and implicitly, i.e. without modifying the projects.

This sounds important, but I don't know what it means.

Doh004
Apr 22, 2007

Mmmmm Donuts...

DreadCthulhu posted:

This sounds important, but I don't know what it means.

Magic?

Doctor w-rw-rw-
Jun 24, 2008

DreadCthulhu posted:

This sounds important, but I don't know what it means.

If you have an Xcode project A that another Xcode project B depends on, them being in the same workspace will let project B find project A without having to manually add project A to the project file, just the workspace.

LP0 ON FIRE
Jan 25, 2006

beep boop
In Cocos2D after resizing a tile atlas from 256x512 to 256x1024 pixels and changing the width/height properties in the tmx file, I get an assertion failure if I select tile anywhere below 512 on the tile atlas and draw them on the map. "Only 1 tilset per layer is supported" even though it's drawn on the correct layer.

More info here: http://stackoverflow.com/questions/18021881/cocos2d-only-1-tilset-per-layer-is-supported-after-resizing-tile-atlas

Anyone know what's going on here?

lord funk
Feb 16, 2004

Anyone else see the NYTimes Objective-C style guide? It's so close to the Apple Objective-C style guide that you have to wonder why they even bothered.

Froist
Jun 6, 2004

lord funk posted:

Anyone else see the NYTimes Objective-C style guide? It's so close to the Apple Objective-C style guide that you have to wonder why they even bothered.

Yeah, I sent this round to a few people at work to prove I was right on a few things. There are a couple of people who're morbidly afraid of dot notation and still weren't won over by this :(

The only ones that I don't already follow are "else on its own line", "dealloc at the top" and the CGRect functions which I had no idea existed.

lord funk
Feb 16, 2004

Speaking of style guides uggggghhhhh do I hate running across methods like this in 3rd party libraries:

Objective-C code:
- (id) _fastInit:(NSString *)addr:(BOOL)addrHasWildcards:(OSCMessageType)mType:(OSCQueryType)qType:(unsigned int)qTxAddr:(unsigned short)qTxPort	{
This is just about enough for me not to use this. Anyone using an OSC library that isn't a royal pain?

Adbot
ADBOT LOVES YOU

Toady
Jan 12, 2009

Froist posted:

The only ones that I don't already follow are "else on its own line", "dealloc at the top" and the CGRect functions which I had no idea existed.

A lot of people overlook those, as well as the NSRect equivalents. CGGeometry.h and NSGeometry.h have a ton of useful stuff.

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