|
CRIP EATIN BREAD posted:I'm a C coder by trade, but I've been working on an iOS project lately and I'm looking to overcome some problems that seem to be creeping up on my application. You can actually insert new objects by Entity name (NSString) too: [NSEntityDescription insertNewObjectForEntityForName:@"MyEntity" inManagedObjectContext:ctx]; So you don't need to have the actual entity around if you know the name at that point in the code.
|
# ? Mar 2, 2012 01:56 |
|
|
# ? May 16, 2024 16:06 |
|
Bob Morales posted:Xcode is such a crash-happy piece of poo poo It crashes whenever I try and drag a file between one xcode project to another or just plain doesnt do anything.
|
# ? Mar 2, 2012 02:59 |
|
CRIP EATIN BREAD posted:It doesn't make sense to have a global NSManagedObjectContext available to anyone if I am passing it to my child view controllers, correct? A managed object context is, in some sense, a scratchpad for managed objects. You can create a new context, add/change/delete managed objects, then either save or dispose of the context to commit or rollback your changes. So if you're passing a managed object context into a view controller (which is common), then that view controller probably don't need to use some a global context. Some people like using a global context and doing everything through it. That can work too. quote:When creating an entity, you obviously need this NSManagedObjectContext. However, the method requires you to pass an entity descriptor. Where is the best place for this code to exist? Does it make sense to have a factory that is constructed with the NSManagedObjectContext to create the objects? I'm a big fan of mogenerator. It'll read in a data model (.xcdatamodel) and dump out a bunch of classes, two per model: an autogenerated 'machine' class that defines @properties, +insertInManagedObjectContext:, -add[ToManyRelationship]Object:, and other useful things; and a subclass of the generated class that you implement your own custom behaviour on. Whenever you change your .xcdatamodel, re-run mogenerator to regenerate the machine classes. quote:I have some data that is unique to the user that is stored in Core Data (fetched from a server, stored locally), and I have different ways of organizing it that is used in multiple places. Does it make sense in this case to have a singleton object that exposes these different organized data? That could work. I imagine you're just fetching what you need from Core Data, so something like a class method on the managed object might work.
|
# ? Mar 2, 2012 03:57 |
|
I'm having a weird Core Data problem. I've got two entities, flight and aircraft, with a class to add items to each. They have a one to many relationship (an aircraft can have multiple flights). I'm passing the information about flights and aircraft to the "add flight" function, which then calls the "add aircraft" function. However, when I do that, Core Data never makes any calls to SQL to insert the data, even though the Flight and Aircraft objects seem to be made appropriately. If I comment out the call to "add aircraft", the flights get added fine (without the AC info). At this point, I'm totally confused by what's going on. Oddly, if I comment out that line of code in flightWithInfo, it adds everything to the database without a problem, but doesn't seem to update until I quit the app and restart. code:
code:
|
# ? Mar 2, 2012 04:09 |
|
duck monster posted:It crashes whenever I try and drag a file between one xcode project to another http://openradar.appspot.com/10597149
|
# ? Mar 2, 2012 06:06 |
|
pokeyman posted:I'm a big fan of mogenerator. It'll read in a data model (.xcdatamodel) and dump out a bunch of classes, two per model: an autogenerated 'machine' class that defines @properties, +insertInManagedObjectContext:, -add[ToManyRelationship]Object:, and other useful things; and a subclass of the generated class that you implement your own custom behaviour on. Whenever you change your .xcdatamodel, re-run mogenerator to regenerate the machine classes. Oh god this makes my life so much easier. I do not know how I never came across this tool. This reminds me of another tool I've used (gas3 generator for GraniteDS on Flex), which did the same thing, generate two classes, one that doesn't change, and one that the tool is free to destroy. Also, the primitive accessors are so nice since I like to have enumerators for values and hate littering my code with intValue but wouldn't add the class methods due to Xcode destroying them when I generate new classes. pokeyman posted:That could work. I imagine you're just fetching what you need from Core Data, so something like a class method on the managed object might work. This is a really good idea, I hadn't thought about this, but that's probably because I was going to get tired of copy/pasting my class methods every time I generated the code and Xcode destroyed it. Your suggestion above fixes that. Thanks again.
|
# ? Mar 2, 2012 16:26 |
|
More RestKit you say? Automatic mapping for multi-part JSON or if you can control the JSON output: This doesn't help me much except in one case you can see below but if your JSON data is organized by keys at the top level then RestKit can find the appropriate mapping automatically. This is useful if your response contains multiple types of objects or if you can control the output easily and don't want to have to specify the mapping class manually. Essentially just call [_mappingProvider setMapping:map forKeyPath:@"fancytown"] instead of [_mappingProvider addObjectMapping:x]. When the top-level JSON is parsed and the key fancytown is found it will use the specified map automatically. I didn't bother because it would require a whole extra layer of objects to make WCF output JSON this way. Error response handling: In the case of errors I did take the time to have WCF wrap them in an extra object layer (JsonErrorWrapper class with one property "error" that contains a JsonError object that simply hold the message and other details). Ultimately this looks like: { error: { errorMessage:"blah", otherProp:"blah" } } On the Objective-C side I just created a WcfErrorMessage class that has the corresponding properties (errorMessage, etc). Then I just call [_mappingProvider addObjectMapping:wcfErrorMap forKeyPath:@"errors"]. Personally I setup a method on my app delegate to handle errors and have my controllers forward them on: code:
A word of caution about CoreData: If the PUT/POST fails, the object will not have been created or updated on the server so you need to either delete it (if isNew), roll back the changes (if !isNew), or allow the user to retry. Similarly for a DELETE operation I generally wait to call the context delete: until the objectLoader:didLoadObjects: delegate because I can be sure it was really deleted by the server at that point. This can be slightly tricky to get right because as far as the user is concerned the UI will be showing them changes that have not been persisted to the server and things will be out of sync. Every app's strategy will be different here (using flags in CoreData to retry/allow offline editing, throwing away the changes if they fail, etc) and you don't want to get into a situation where you are eternally retrying changes that will always fail (missing field, FK violation etc) or where the user has stale data in CoreData that the app never fixes.
|
# ? Mar 2, 2012 23:32 |
|
That was (is?) a fantastic intro to RestKit. If you have any interest whatsoever in some copypasta, I think they'd make a great addition to the RestKit wiki. Probably easier to find there than here for others struggling with RestKit.
|
# ? Mar 3, 2012 01:17 |
|
I may see if I can edit that into something coherent. I'm getting married next weekend so things are a bit hectic at the moment.
|
# ? Mar 3, 2012 15:54 |
|
Yeah no rush, and I might beat you to it if it's ok with you. Also, congratulations!
|
# ? Mar 4, 2012 06:41 |
|
I was hoping my app would get approved before Apple's Big Announcement, and it was reviewed & approved yesterday. Makes me wonder if they always have reviewers working on the weekend/Saturday, or if it's just in anticipation of a lot of developers trying to get their apps on the store before Wednesday. I'll put up some promo codes once it actually hits the store (release date is Monday). Kind of worried that people will think my app is dumb, but it was mostly made for myself, friends, and family, so whatever.
|
# ? Mar 5, 2012 03:53 |
|
Your app looks really cool! I think it will be a big success.
|
# ? Mar 5, 2012 05:29 |
|
Thanks! Naturally, a few days after submitting my app, Gruber linked to this other score keeping app. Still, mine has pictures Doc Block fucked around with this message at 06:09 on Mar 5, 2012 |
# ? Mar 5, 2012 05:56 |
|
Doc Block posted:Thanks! You freaked me out. I also have a scorekeeping app, but it's a bit more specialized: darts only. However, I play backgammon and keeping track of points has always been a bit of a pain, so I'll probably download your app and see how it works, because I could really use something like that.
|
# ? Mar 5, 2012 07:07 |
|
Either I screwed something up, or Apple jumped the gun, but it's out now. Weird that the release date shows March 3, yet I changed the release date to March 5. Maybe it's because I did it while it was in review. Here it is. Some promo codes: 6YLAN7RAL9XY 7TA9HWAAHNHE RFLHJJ9F44JJ NWREFHEAYRJM 9M7WW6WA96FA Doc Block fucked around with this message at 07:55 on Mar 5, 2012 |
# ? Mar 5, 2012 07:26 |
|
Can someone confirm or deny whether the OSX Mountain Lion Preview includes support for tessellation shaders on compatible GPUs? I have a 2011 MBP with the Radeon 6750m. Could someone dump for me the supported OpenGL extensions somehow? I need to figure out if its worth spending the $100 on the developer membership since I need tessellation shaders for my research work. e: There's an opengl extension viewer on the App Store available for free if someone wants to help me out. shodanjr_gr fucked around with this message at 22:06 on Mar 5, 2012 |
# ? Mar 5, 2012 22:02 |
|
What's the equivalent of "backtrace" on the LLVM debugger?
|
# ? Mar 6, 2012 19:37 |
|
We have an iOS app which is distributed through the app store. The app has settings available via the Settings pane. I have a user that has a bunch of iPads and he wants to 'lock down' our app as far as settings go - basically he doesn't want his users to be able to change the settings for our app. He'd probably be fine with locking down all the settings on the iPad. I thought the iPhone Configuration Utility would be able to handle this but I don't see any way to lock down the settings. Is there any other way to accomplish something like this?
|
# ? Mar 7, 2012 00:24 |
|
Small White Dragon posted:What's the equivalent of "backtrace" on the LLVM debugger? "bt" or "thread backtrace" http://lldb.llvm.org/lldb-gdb.html
|
# ? Mar 7, 2012 00:46 |
|
Is there an easy way to enable all the warnings in a '-Wall' kind of way using Xcode 4?
|
# ? Mar 7, 2012 14:59 |
|
'Other warnings flags' in the project or target's build settings. Just add -Wall
|
# ? Mar 7, 2012 19:46 |
|
Welp, time to dust off the old '@2x' Photoshop script for the iPad 3.
|
# ? Mar 7, 2012 20:01 |
|
Am I correct in assuming that there is no way for a mobile html5 site to let someone upload a photo? Because if so... motherfucker, I have money to pay back
|
# ? Mar 7, 2012 21:12 |
|
Far as I know <input type=file> is unusable on MobileSafari.
|
# ? Mar 7, 2012 21:55 |
|
lord funk posted:Welp, time to dust off the old '@2x' Photoshop script for the iPad 3. Yep one more to add to the list: Although maybe this will be the last year I'll have to support regular resolution for the iPhone/iPod? iOS 6.0 required please.
|
# ? Mar 7, 2012 22:00 |
|
Looks like Xcode 4.3.1 has finally dropped. edit: haha, the retina iPad simulator scrolls. edit 2: I wonder what the maximum texture size is. Small White Dragon fucked around with this message at 00:19 on Mar 8, 2012 |
# ? Mar 7, 2012 22:29 |
|
Hey, the new Xcode is out. Hope you don't mind having to re-download everything that isn't for the latest iOS version! I thought delta updates were supposed to eliminate this kind of BS. They've got to be intentionally uninstalling them. Doc Block fucked around with this message at 04:57 on Mar 9, 2012 |
# ? Mar 9, 2012 04:54 |
|
I can't really speak for that team, but I think this specific update just completely defeats the delta-update mechanism. The installed package has been significantly reorganized, and pretty much everything is now installed within the Xcode app bundle itself instead of in /Developer. Future updates relative to this one should still be delta updates, and indeed the delta mechanism will probably be somewhat more effective now. ETA: Oh, if it's mangling previous SDKs somehow then I really don't know. rjmccall fucked around with this message at 05:00 on Mar 9, 2012 |
# ? Mar 9, 2012 04:58 |
|
Speaking of mangling things. What kinds of strategies do you guys use with respect to Xcode's file "groups" versus the filesystem. Right now I have groups that sort of mirror the filesystem's folders, but that's pretty cumbersome to maintain... This guy more clearly describes the problem: http://majicjungle.com/blog/123/ posted:Xcode offers two options when you add a directory to the project. You can either add it as the default yellow ‘group’ or as a blue ‘folder reference’. The problem is, that both have pretty major limitations (and bugs). He offers a solution, and there are some alternatives in the comments as well, but I don't think this is how you're "supposed" to use Xcode. Any thoughts or guesses on what Apple actually intends?
|
# ? Mar 9, 2012 05:34 |
|
rjmccall posted:I can't really speak for that team, but I think this specific update just completely defeats the delta-update mechanism. The installed package has been significantly reorganized, and pretty much everything is now installed within the Xcode app bundle itself instead of in /Developer. Future updates relative to this one should still be delta updates, and indeed the delta mechanism will probably be somewhat more effective now. Yeah, I already got the update that moved everything to /Applications. My app supports iOS 4.3, so I had downloaded the 4.3 simulator and whatnot, only to find that yesterday's Xcode update deleted them.
|
# ? Mar 9, 2012 05:48 |
|
Hmm. I better check time machines backing up /Developer then. I'm already frusturated shitless by Apple continuous insistance on thoughtlessly nuking my python package directories every major update.
|
# ? Mar 11, 2012 19:59 |
|
Storm Sim users are getting active assertions errors that kill the app after updating to iOS 5.1... Is anyone aware of changes to audio handling in the latest update? The app is setup to allow mixing audio with other apps and to allow background playback. This has always worked before without issue but suddenly does not. This is obviously the worst time since I just got married and am going out of town in a few hours.
|
# ? Mar 13, 2012 08:21 |
|
Ender.uNF posted:Storm Sim users are getting active assertions errors that kill the app after updating to iOS 5.1... Is anyone aware of changes to audio handling in the latest update? The app is setup to allow mixing audio with other apps and to allow background playback. This has always worked before without issue but suddenly does not.
|
# ? Mar 13, 2012 08:29 |
|
I'm looking for some app developers to add to my company's rolodex. We're a Washington, DC based design firm that sometimes dabbles in app design but not development. When a client comes to us with an idea about half the time we'll consult on/do some design and partner up with a developer, and the rest of the time we just pass it along to a developer if we feel it's totally out of our scope. We need someone who's established / has a solid portfolio of work / is extremely professional / etc etc. We don't want to refer clients to some sperg-stoner who's going to miss deadlines and suck. Oh, and we always get real budgets for our projects... so we're not going to spam your inbox with crappy stuff like, "I have this idea for this thing that's kinda like Facebook... I have $500." We have a project coming along right now that would have a big video section, so experience there would be handy. PM me your info (website / email / who we should get in touch with) if you work someplace I should know about! Danku in advance, goonygoons. PS. Also let me know if there's somewhere else that'd be good to post this. I'm not super familiar with this subforum
|
# ? Mar 13, 2012 17:29 |
|
I have an enterprise provision mess on my shoulders right now. The company that I made an enterprise iPad app for did not renew their provision nor their account. As soon as they paid for a new yearly fee, I had access to their account but the provision was expired. There was no renew button, and the distribution certificate was gone from the portal. So I removed the provision, and made one with the same name and another certificate that associated with that provision, downloaded those both and synced with my iPad. And of course, the app does not launch, and why would I expect it to since the app is associated with the old provision.. So the disaster here is that there's around 100 iPads around the world with this app on it. Do I really need to rebuild the app with the new certificate and it pointing to the correct provision in the build settings? If that's true I'll have to redistribute it. I'd rather just send everyone a new provision. Another thing is that I thought this provision was never supposed to expire. It's not an Ad Hoc but an In House provision. Restarted organizer and that issue cleared up. But I still can't figure out a way to make this work without making a new build. Enterprise distribution has been a nightmare to me. Ultimately, if none of this works without making a new build, I'd like to know a way of distributing enterprise apps without having poo poo expire. LP0 ON FIRE fucked around with this message at 19:15 on Mar 13, 2012 |
# ? Mar 13, 2012 18:05 |
|
duck monster posted:Take it off the store and worry about it when you get back. Your app is not as important as your wife. Oh I am not crazy enough to spend the time debugging. I just wonder why Apple changed the behavior of the playback category with allow mixing override. I am guessing that if I remove the allow mixing flag it will fix the problem.
|
# ? Mar 13, 2012 20:30 |
|
kedo posted:PS. Also let me know if there's somewhere else that'd be good to post this. I'm not super familiar with this subforum There is a job thread that you might want to post it in: http://forums.somethingawful.com/showthread.php?threadid=3246449
|
# ? Mar 13, 2012 20:51 |
|
I am going insane. Why won't my modal UIImagePicker go away?code:
EDIT OK, I "solved" it, but I still have no clue why this works, but my orignal attempt doesn't. In ApplicationDelegate: code:
Lumpy fucked around with this message at 22:01 on Mar 13, 2012 |
# ? Mar 13, 2012 21:49 |
|
It might help if you included how you present the UIImagePicker.
|
# ? Mar 13, 2012 22:41 |
|
|
# ? May 16, 2024 16:06 |
|
drat... I just upgraded my work's iPad to iOS 5.1, and it seems that I can no longer test on this device unless I upgrade to Lion to install the new Xcode. I get this when I try to run: Am I right about that?
|
# ? Mar 13, 2012 22:42 |