Hi,
I've just read Apple's docu of NSScanner.
I'm trying to get the integer of that string: @"user logged (3 attempts)".
I can't find any example, how to scan within parentheses. Any ideas?
Here's the code:
NSString *logString = @"user logged (3 attempts)";
NSScanner *aScanner = [NSScanner scannerWithString:logString];
[aScanner sca...
I'm assuming my understanding of how to perform a deep copy isn't just there yet. The same with some sub-optimal memory handling that I'm performing down below. This code below probably depicts a shallow copy, and I believe that's where my problem might be. I have some cookie-cutter code for an example that looks like the following:
NSA...
I have trouble understanding Cocoa Bindings. Can someone explain me what this is all about, in an way that is humanly perceivable?
...
I can't find in the Docs where they explain all those fields and what they mean. Especially "Controller Key" is not clear to me.
...
When I use Interface Builder > Inspector > Bindings to set up an binding for one of my view Items (i.e. an textfield), then I have to specify an object to which this view item will be bound to.
So I am wondering now, what exactly is the job of this object I specify in "Bind to:"?
I assume that Interface Builder automatically creates som...
Can someone explain in an humanly understandable way what an "Outlet" is?
...
Apple says:
An attribute of an NSController object. When binding to an NSController object, you use this field to select the first entry in the key path. The menu associated with this field displays the properties available on the selected controller object as a convenience. You can type the name of the property or simply select it f...
I don't understand how the term "Document" is used in objective-C and cocoa. When I build an Application, why do I have an "Document"? That makes no sense to me. I could have an Application like an Image Editor, wherein I can open like 100 Images at same time. So every Image is a Document and has its own Nib file? Can someone explain tha...
In the Apple Docs they say that a Nib enables internationalization by just translating the Nib into many languages. I am thinking now about a worse but realistic scenario: You have made a huge user interface. Then you translate this into 25 languages. So you get 25 different Nibs. You also get a huge redundancy in styling and defining th...
Unfortunately, the explanation of File's Owner is pretty short at the Apple docs. I know it is an proxy object. But what's really the point about that "File's Owner" object? What is it good for?
...
I find that the xcode-builtin-documentation reader is hard to use. I want to see the root of all Guides available, to get an idea of how long I will have to keep reading until I can start. All the time some new Guide pops up to me, and I am wondering how many they are.
Is there an overview somewhere?
...
Actually I don't care too much about Mac OS X development. I want to do only iPod Touch and iPhone development. But anyways, I started learning Cocoa and Objective-C. But it seems like there are many differences between Cocoa and Cocoa Touch, so I am wondering if I am actually wasting my time. Should I just jump directly into iPhone topi...
Let me summarize that shortly: A "First Responder" in a NibFile is an Object, which represents the UI control element that has the user's focus. So if the user klicks on an UI control, the Nib sets that clicked UI control as First Responder. In my app I could make an outlet to that "First Responder" from the Nib, so that I could for exam...
Let me summarize that shortly: A "First Responder" in a NibFile is an Object, which represents the UI control element that has the user's focus. So if the user klicks on an UI control, the Nib sets that clicked UI control as First Responder. In my app I could make an outlet to that "First Responder" from the Nib, so that I could for exam...
I cannot get this method to return YES:
- (BOOL) writeToPasteBoard:(NSString *)stringToWrite
{
return [pasteBoard setString:stringToWrite forType:NSStringPboardType];
}
I have verified that stringToWrite is coming through properly, the method just always returns NO.
Any ideas?
Here is the rest of the class:
@interface ClipBoard...
Here's a mockup:
I have been trying to find some sample code that showcases something like this -- a scroll view with a list of custom views. Haven't found anything. I've been trying to find some open source projects that does this (that isn't Adium with a million files and lines of code), but haven't found anything there either.
I'v...
I'm currently polling my CFReadStream for new data with CFReadStreamHasBytesAvailable.
(First, some background: I'm doing my own threading and I don't want/need to mess with runloop stuff, so the client callback stuff doesn't really apply here).
My question is: what are accepted practices for polling?
Apple's documentation on the subj...
Does someone have a easy-to-understand example what this Application object is good for? Why is it there? And in what cases do I need it?
...
I have an NSTimer which is setup like this:
[NSTimer scheduledTimerWithTimeInterval:0.5 target:timerTarget selector:NSSelectorFromString(targetSelector) userInfo:nil repeats:YES];
How can I get the return value of the timerTarget method?
...
What is the correct way to store an NSImage in a Core Data Model? I have assumed adding an Attribute to an Entity and giving it the Type "Binary" should work, but it is not working. I have a table with a column of NSImageCells and it is not showing anything.
...