Thanks very much for your response. You pointed me in the right direction.
On 26/01/2012, at 3:23 PM, Ken Thomases wrote: > First, why are you using strings to convert to NSDecimalNumber? Ask the > NSNumber for its decimalValue and then use +[NSDecimalNumber > decimalNumberWithDecimal:]. That avoids formatting and parsing of strings. > > Second, why do you need NSDecimalNumber? Can you not use either unsigned > long long or double for this purpose? You're right I changed this to use NSDecimals and C methods instead. I'm a little cautious about going to long longs or doubles because I want to be sure that it'll work if Apple changes the format of the elements in the dictionary. >> This problem seems to depend on the compilation order. Commenting out the >> offending code, recompiling, then restoring the code and recompiling makes >> the problem go away. Performing a Clean operation than recompiling makes >> the problem reappear. This suggests compilation order affects whether the >> systemInfo dictionary has valid elements or not at runtime. > > I doubt that. Probably, you have an uninitialized variable or stack smashing > bug somewhere and the compilation order affects the layout of the stack which > changes either what garbage is in the uninitialized variable or what on the > stack gets smashed. > > Certainly, you can log the values you get from systemInfo to check your > hypothesis. I did what I should have done in the first place. Pass an error object into NSFileManager and see what it reports. Yeah, it was a case of uninitialised values, and was relatively easy to track down once I'd done that. >> As to why @dynamic is there, I thought that was the proper way to implement >> a property where the implementation was supplied by me rather than >> synthesised. Is that not the case? > > You don't need @dynamic for properties where you supply the accessors at > compilation time. It's only necessary for when the accessors aren't > apparently available but will be at runtime. For example, by dynamically > loading a category or self-modifying code. (NSManagedObject uses something > like the latter.) Thanks, this was clearly my misunderstanding the way it worked. I've cleaned it up. Cheers, Arved _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
