objective c - Nested method calls vs. one-shot variables -
What method is best practice by making a call nest or using a shot variable?
Should you never do that? Examples of one shot variable
example: [NSDL fileURLWithPath: [applicationSupportDirectory stringBeeAppendingPathComponent: @ "storedata" NSDiction dictionary with object: [NSNumber Number: Forbes: Yes] KA: NSMIGetCentententorsautomatikation] Error: & amp; Error];
You should always break a nested method in a shot variable
Example:
NSNumber * yesNumber = [NSNumber numberWithBool: Yes]; NSDictionary * optionsDict = [object with NSDictionary dictionary: yesNumber forKey: NSMigratePersistentStoresAutomaticallyOption]; NSString * urlPath = [Application Support Directory stringbappinging company: @ "stored"]; Ns url * url = [NSUr file URL with path: urapith]; [Persistent Story Coordinator Editor's Storwyth Type: NSXMLStore Type Configuration: Zero URL: URL Options: OptionsDict: Error; And editions]; You must use some combination of
or two
example:
NSDictionary * optionsDict = [NSDictionary dictionaryWithObject: [NSNumber] Number: Bull with: Yes] Key: NSMIGetCententatorsAutomatication]; Ns url * url = [nsur file urlathatha path: [application directory directory stringbayment path comparison: @ "stored"]]; [Persistent Story Coordinator Editor's Storwyth Type: NSXMLStore Type Configuration: Zero URL: URL Options: OptionsDict: Error; And editions];
I go with a combination of both but I would like to hear what everyone else has to say about this. If this above is not clear, then this "one-shot variable" is designed for the sole purpose of breaking the nested system and it will not be used anywhere. Personally, I think that you should use a "one shot" variable (in "release" mode, which is with optimization) and debugging it. You certainly do not have a specific reason.
Comments
Post a Comment