|
Yah, you guys are right I'm just being really stupid. I'm trying to do 3 steps too many. I ended up just changing the class that gets registered (for the UITableView) to be the inherited class and I'm able to get the correct class now.
|
# ? Jul 23, 2013 22:57 |
|
|
# ? May 17, 2024 15:56 |
|
Doh004 posted:I have a property: This doesn't work because a class object isn't a type, so it thinks the * is a multiplication.
|
# ? Jul 24, 2013 03:18 |
|
I just wasted a couple days of work trying to figure out a problem, and then I realized I didn't assign an object's parent equals self (object.parent = self) I've made this mistake before, but I was wondering why it's necessary to do this. Why can't an object automatically assign this?
|
# ? Jul 24, 2013 22:32 |
|
How? Maybe the parent should instead have a addChild: method that (among other things) sets the child's parent property. You definitely shouldn't be doing it by hand every time you create an object, assuming the objects in your object graph require setting the parent property.
|
# ? Jul 25, 2013 00:29 |
|
Yeah that's a little too "why doesn't the compiler guess what I want".
|
# ? Jul 25, 2013 00:37 |
|
Dev center is starting to come back online: https://developer.apple.com/support/system-status/
|
# ? Jul 25, 2013 00:52 |
|
The whole "we'll overhaul our system in a week" claim is pretty absurd. It's obvious they're not willing to reveal what actually happened. Nothing of that size at an organization of that magnitude can be "overhauled" in a week. That's maybe how long it'd take to schedule a meeting with all the necessary parties to start planning an overhaul
|
# ? Jul 25, 2013 01:11 |
|
Everything related to the developer portal is such a hacked together mess that I can't imagine there's a significant number of people involved in it normally.
|
# ? Jul 25, 2013 01:18 |
|
LP0 ON FIRE posted:I just wasted a couple days of work trying to figure out a problem, and then I realized I didn't assign an object's parent equals self (object.parent = self) Core Data will do that for entity relationships.
|
# ? Jul 25, 2013 07:45 |
|
Toady posted:Core Data will do that for entity relationships. What? I guess maybe LP0 ON FIRE should clarify what's going on. I'm picturing this: Objective-C code:
|
# ? Jul 25, 2013 08:39 |
|
So having just returned from holiday to find my dev iPhone needs its iOS 7 beta updating before it will work, I've run into the issue of the developer center being down. Any guesses as to how long it might be before its back up? Also do I have any alternatives to updating the beta?
|
# ? Jul 25, 2013 11:15 |
|
Reverse/inverse relationships in Core Data are special and have stuff in the backend to handle it, ie -[NSRelationshipDescription inverseRelationship] If you implement your own thing, you should create KVC collection accessors that sets/unsets the parent as needed, like so (untested): Objective-C code:
Carthag Tuek fucked around with this message at 12:07 on Jul 25, 2013 |
# ? Jul 25, 2013 12:05 |
|
I'll ask here since the dev forums are down: I'm assuming I'm missing something obvious, but how do I tell UITabBar (or its controller) to display in the text-only fashion that, for example, Calendar uses in iOS [redacted]? I found the attributes for UIToolbar, but the same techniques don't seem to apply to a tab bar.
|
# ? Jul 25, 2013 13:05 |
|
Carthag posted:Reverse/inverse relationships in Core Data are special and have stuff in the backend to handle it, ie -[NSRelationshipDescription inverseRelationship] Shouldn't the children array be hidden away as an implementation detail, though? It'd be better, IMHO, to just have addChild: and removeChild: methods, with the children array not publicly exposed. Or, if it has to be exposed, have the publicly visible property be an NSArray with the readonly attribute set.
|
# ? Jul 25, 2013 14:08 |
|
Doc Block posted:Shouldn't the children array be hidden away as an implementation detail, though? It'd be better, IMHO, to just have addChild: and removeChild: methods, with the children array not publicly exposed. Any access to the array will be funnelled through the accessors by KVC (if they are named correctly) so you can guarantee that the parent will always be up to date. When you go thing.children, you're actually given a KVC-proxy (might be isa-swizzled), which when you add/remove objects checks the thing class for accessors that fit the pattern, and uses them. E: In fact, you don't even need to have an array for a backing store, it could be some weird homecooked poo poo. Carthag Tuek fucked around with this message at 14:54 on Jul 25, 2013 |
# ? Jul 25, 2013 14:27 |
|
Doc Block posted:How? Yeah it's getting kind of annoying. code:
|
# ? Jul 25, 2013 19:03 |
|
You make a method on whatever self is that makes a plant, sets its parent property to self, and adds it to the plants array. You can call it addChild: or whatever you want. That way you're only writing that code once, and can know that it always works.
|
# ? Jul 26, 2013 00:23 |
|
Carthag posted:Any access to the array will be funnelled through the accessors by KVC (if they are named correctly) so you can guarantee that the parent will always be up to date. I guess I just don't like magic side effects like that. IMHO, adding an object to a mutable array shouldn't do anything other than add the object unless you have a very good reason and it's very well documented that the other effects happen. An ordinary method makes it more obvious that other things can/will happen.
|
# ? Jul 26, 2013 01:19 |
|
So I think the submission process is still borked. I've been sitting at "Processing for App Store" for almost an hour now. Worst. Week. Ever. Edit: And five minutes later it's in the store and Apple proves me wrong. gently caress you Apple. ultramiraculous fucked around with this message at 04:30 on Jul 26, 2013 |
# ? Jul 26, 2013 04:23 |
|
pokeyman posted:What? I assumed he was talking about adding a child to a model object and having the parent get set automatically, so I was recommending the use of Core Data for his model since it'll maintain referential integrity for him. Toady fucked around with this message at 05:46 on Jul 26, 2013 |
# ? Jul 26, 2013 05:37 |
|
Doc Block posted:I guess I just don't like magic side effects like that. IMHO, adding an object to a mutable array shouldn't do anything other than add the object unless you have a very good reason and it's very well documented that the other effects happen. An ordinary method makes it more obvious that other things can/will happen. Eh, it's "magic" in Core Data too. But to each his own. I like being able to treat the property as a normal array and knowing that the parent on its contents will remain up to date.
|
# ? Jul 26, 2013 10:28 |
|
Are there any kind of very thorough cheat sheets or references guides for ObjectiveC out there, and possibly Cocoa for people like me who don't work much with the ecosystem any longer, but occasionally need to jump back for a week or two and be immediately highly productive?
|
# ? Jul 26, 2013 23:28 |
|
Bunch of stuff is back up now, just FYI.
|
# ? Jul 27, 2013 00:03 |
|
DreadCthulhu posted:Are there any kind of very thorough cheat sheets or references guides for ObjectiveC out there, and possibly Cocoa for people like me who don't work much with the ecosystem any longer, but occasionally need to jump back for a week or two and be immediately highly productive? I would love something like this as well just because I will be starting a full time job doing iOS work in three weeks and it has been probably a few months since I have cracked open Xcode except to do their pre-interview screening test. I could stand to have a refresher.
|
# ? Jul 27, 2013 00:12 |
|
I'd better grab Xcode 5 DP3 before the PowerMac G3 running the dev center falls over again.
|
# ? Jul 27, 2013 00:12 |
|
What are people's thoughts on wrapping JSON data passed by an API into a custom object? Both my API and web client think very heavily in terms of maps that fit very well a JSON-like schema. Things tend to change quite a bit, so these "objects" lose and acquire keys, variables go from strings to number to arrays etc. Obviously changes need to be made everywhere when this happens, but ObjectiveC would have the additional burden of requiring an update the boilerplate class you convert these JSON objects/dictionaries to. Actually, writing boilerplate to create those classes in the first place is a bit of a pita. One option is to keep JSON data in a generic NSDictionary and hope you don't forget to keep the keys and value types in sync. You postpone type checking until that piece of data is already somewhere deep in your business logic where it can explode, potentially being very confusing. Parse works somewhat along those lines where they always return a generic PFObject and you can either make a proper object for it, with the right properties, or you can use it like a dictionary. I'm curious if most people tend to opt towards flexibility and using a dictionary, avoiding the overhead of updating boilerplate classes. Did this scale at all? I'm also suspecting there might be a way of automating the generation of these classes, and I'm simply not aware of this.
|
# ? Jul 27, 2013 02:21 |
|
Every time I try to get away without duplicating model definitions in the API and the thing consuming the API it's turned out to be more problematic than it's worth, especially when compile-time type checking is an option. Minimizing the boilerplate involved is definitely important, though. Mantle is decent for that, although IMO it tries to be too flexible and so doesn't go far enough. If you have a bajillion model types then something based on class_copyPropertyList may be worth it to completely eliminate any sort of duplication in the obj-c code. CoreData + mogenerator + RestKit is another zero-duplication option.
|
# ? Jul 27, 2013 02:49 |
|
Mantle looks pretty interesting, I'll give that a shot. I guess there's not that much work in addition to what I'm already doing, so no reason not to leverage type checking when possible.
|
# ? Jul 27, 2013 07:27 |
|
Those of you familiar with AFNetworking, what is the interface for id responseObject you get back in the successful callback when fetching some JSON? Is it just a NSDictionary hiding behind that id? I suck and have not been able to determine what the specific interface to this object is besides KVC. In fact I suspect that might be it. Nvm, in my case it was just a NSArray of NSDictionary, good enough for me. DreadCthulhu fucked around with this message at 22:39 on Jul 27, 2013 |
# ? Jul 27, 2013 22:01 |
|
You can always just do NSLog(@"class = %@", NSStringFromClass([someObject class])) to see what the class you're getting back is. edit: I suspect the reason it returns id is because it can return either an NSArray or an NSDictionary like in Apple's own JSON serialization stuff. Doc Block fucked around with this message at 23:58 on Jul 27, 2013 |
# ? Jul 27, 2013 23:55 |
|
Doc Block posted:You can always just do NSLog(@"class = %@", NSStringFromClass([someObject class])) to see what the class you're getting back is. Yeah I got a bit lazy there, life without a REPL is not worth living. And yes, good point. It's probably because the smallest piece of valid JSON is a {} or [], hence one of those two classes. Definitely pretty happy with Mantle + AFNetworking so far. Unrelated note: what's a sane way of stating that a NSNumber property can be null? Is storing (NSNumber *)[NSNull null] kosher or a hack?
|
# ? Jul 28, 2013 00:17 |
|
DreadCthulhu posted:What are people's thoughts on wrapping JSON data passed by an API into a custom object? My company ended up writing a little pseudocode language and a parser that outputs native objects in each of the languages we use, along with a bit of native language witchcraft to do the deserialization. I'm not sure the engineering time was totally worth it, but I am glad that we have it now.
|
# ? Jul 28, 2013 00:25 |
|
DreadCthulhu posted:Unrelated note: what's a sane way of stating that a NSNumber property can be null? Is storing (NSNumber *)[NSNull null] kosher or a hack? Just store nil.
|
# ? Jul 28, 2013 03:45 |
|
Ya nil translates to null in NSJSON
|
# ? Jul 28, 2013 04:09 |
|
DreadCthulhu posted:Unrelated note: what's a sane way of stating that a NSNumber property can be null? Is storing (NSNumber *)[NSNull null] kosher or a hack? I'm sure you already know this, but this is ultimately C, so the only magic tricks the compiler knows is casting the integral types like int <-> double, and there are no overloaded operators. So that sort of cast is definitely a huge no-no; in C++ or C# you could overload the cast operator and actually support something like this and even Java understands how to coerce some user-defined types, but C has no clue. Generally you just use nil for an empty or missing value. NSNull (why not NSNil? heh) is used for situations like collection classes that cannot actually represent nil internally like NSDictionary, which IIRC is due to the fact that varargs in C cannot tell you their length, which is due to the C ABI and whatever decisions were made in like 1970, so all the initializers have to use nil as a sentinel to indicate end of list, otherwise you'd have to pass an extra parameter indicating the number of items (NSLog/printf count the format strings) I wish we could have a __varargs or something attribute that would say please pass a hidden struct that indicates the type of each parameter and the number of parameters, so you could get the number of passed params and their types at runtime, rather than relying on stuff like nil termination or format strings to tell you. I know we can never change how va_list/va_arg work until the end of time due to compatibility but at least we could introduce an opt-in behavior that was better. For that matter, I wish something like @encode and whatnot were made standard and part of the blocks API and C in general so I could ask for the type signature of a function or a block, probably some standard structure like "struct __typedefinition { uint integralType, int membersLen, __typedefinition* members }" where the integral types are enums for int8/16/32/64/128, float 32/64/80, pointer, struct, etc that could also recursively indicate the type information for structures and functions like __typename(__typedefinition*)/__callsignature(fp*) , but rjmccall can probably tell me why that's a bridge too far or not workable. There's no way any of my ideas are new ones so I have to assume there is a good reason it hasn't been done. Simulated fucked around with this message at 16:12 on Jul 28, 2013 |
# ? Jul 28, 2013 16:09 |
|
There's https://github.com/jspahrsummers/libextobjc/blob/master/extobjc/EXTVarargs.h which automatically generates the format string with a bit of macro magic.
|
# ? Jul 28, 2013 19:16 |
|
Booo I just typed up a bug report only to have it error out when I hit send. Should have copied the report before hitting submit.
|
# ? Jul 28, 2013 21:00 |
|
Anybody playing with UIDynamics? I'm getting close to the behavior I want (pulling a view into the edge when it hits the blue target area), but I don't like the wobbly rotation of the view. Anyone know how to disable the rotation of the red view? I'm triggering a UISnapBehavior once the red view collides with the blue view: Objective-C code:
Edit: figured it out. Add another UIDynamicsItemBehavior with the item properties, including allowsRotation lord funk fucked around with this message at 01:16 on Jul 29, 2013 |
# ? Jul 29, 2013 01:07 |
|
Does anyone have the camera I can't just pull a screenshot from the simulator since it's very insistent that it does not support camera image capture, so trying to launch a UIImagePickerController throws an exception before it ever shows the shutter. I did find a stackoverflow post that outlined how to trigger the camera iris animation anywhere (cool). This did work, but the gradients looked like poo poo because it's the simulator. Comparing the authentic screenshot and the fake animation showed it was surprisingly bad. Finally, Google has been insistently refusing to find these images.
|
# ? Jul 29, 2013 02:04 |
|
|
# ? May 17, 2024 15:56 |
|
iOS Artwork Extractor, a little utility that will let you see all the various images and whatnot used in iOS. Run it on the simulator, find the camera iris images, and save them to your desktop.
|
# ? Jul 29, 2013 04:07 |