NSArray creation with variable argument lists
This array convenience method takes a comma-separated list of objects ending with
myArray = [NSArray arrayWithObjects:aDate, aValue, aString, nil];
What is the purpose of the
- A method without parameters is calling for an argument
- Swift - Anonymus function with arguments as callback (syntax)
- Redirecting I/O in Xcode 4
- When do we need button to send argument in Swift?
- iOS performSelectorOnMainThread with multiple arguments
- How to pass an argument to a method called in a NSTimer
2 Solutions Collect From Internet About “NSArray creation with variable argument lists”
Null terminated variable argument lists, or
va_lists, keep walking the list of arguments until they encounter a placeholder or sentinel, which is
Since the method has no way of knowing how many arguments you are passing, it needs the sentinel (
nil) to tell where the list ends.
To mark the end of the list of objects.
Here’s a discussion from CocoaBuilder.
- CustomTableCellView's implementation of -layoutSubviews needs to call super , NSInternalInconsistencyException
- Breakpoint 2.1 Error Parse/Facebook iOS SDK
- How can I call an IBAction in the viewDidLoad?
- Swift – add gesture recognizer to object in table cell
- Methods with multiple arguments in objective C
- Swift error: 'missing return in function'?
- Adding Swift Unit Tests to a Mixed Language Xcode Project
- UIStackView – Distribute views evenly from the centre
- How can I programmatically determine if my app is running in the iphone simulator?
- Detect if client allows inline media playback for HTML5 video
- Can xcodebuild manage automatic signing?
- How to change UIStatusBarStyle in iOS 7 in modal views with navigation bar?
- How to animate the width and height of a UIView in Xcode?
- SVN access denied when comparing revisions
- How to vary the contents in URL in iOS?