I've been working with the Dropbox API as of late, and have run into an infuriating but interesting snag. The SDK saves OAuth tokens in standardUserDefaults, and if the user wants to disable the Dropbox functionality the OAuth tokens have to be removed (otherwise the SDK finds them and goes off to work).
Here's the weird part: whether I...
For example: NSString *strWord = "english";
The result NSArray would be something like: e n g l i s h
I think is possible to do it with
[NSString componentSeparatedByCharacter:somecharacter], but I don't know what that character is...
I wrote something like this to extract the character:
NSString *character;
for (int i=0; i<[strWor...
Is "new" an equivalent of "alloc init" or "alloc init autorelease"?
I cannot seem to find it in any tutorial or article that deals with Cocoa memory management.
Thanks for advise.
...
I wonder if it is possible to write something like this in the .m file:
@interface MyController () {//ERROR here
Foo *privateFoo;
}
@end
I did it but I get :
Expected identifier or '{' before '{' token, I think I heard/watch a video (WWDC2010) saying this is possible or will be possible and currently only some architectures suppo...
In one of my apps, I have a custom drawn semitransparent UIView that I use as a cover on top of another UIView for a special effect.
Lower View:
Lower View with Custom View on Top:
It works, its great on the iPhone where the side margins are only 10 pixels, but now I need to expand the left and right margins to match the row below i...
Hello everybody,
Im using libxml2 on the iPhone with the nice Method: PerformXMLXPathQuery from Cocoa with Love. The problem is how to find out witch xml got sent without first parsing the whole document... I tried to use the @"/" query to retrieve the first element as written on the introduction of Cocoa with Love but unfortunately, th...
In an application I'm making I need to run the following command as root (user will be prompted trice if they really want to, and they will be asked to unmount their drives) using NSTask:
/bin/rm -rf /
#Yes, really
The problem is that simply using Substitute User Do (sudo) doesn't work as the user needs to enter the password to the no...
According to NSObject's documentation:
Important: Note that when an
application terminates, objects may
not be sent a dealloc message since
the process's memory is automatically
cleared on exit --- it is more
efficient simply to allow the
operating system to clean up resources
than to invoke all the memory
management ...
Hey,
I'm not even sure where to begin with this question...
I want to be able to send mouse-click events to another machine, as if the user had clicked on that machine.
I can do it on the same machine via:
CGEventSourceRef source = CGEventSourceCreate(NULL);
CGEventType eventType = kCGEventLeftMouseDragged;
CGPoint mouseCursorPosi...
Googling for CoreWLAN brings a mere 701 results -- Apple's own shallow reference isn't even there, at least not on the first pages.
For instance, I would like to know what are the possible values of kCWScanKeyScanType when scanning for networks. Apple will only say it defaults to APScanTypeActive, but doesn't explain what that means or ...
hello
I created Plugin for providing access to my Frameworks objects. Objects are working good except one controller. When I drag him from library to file arise very interesting assert.
Assertion Message: An exception was raised while -[IBLibraryController assetLibrary:didFinishDraggingAssets:info:shouldSlideBack:] was executing.
O...
I have an NSArray which holds Foo objects defined like so:
@interface Foo : NSObject <NSCopying> {
NSString *name;
}
@property (nonatomic, retain) NSString *name;
@end
and the query:
NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"name BEGINSWITH[cd] %@", filterString];
//NSPredicate *filterPredicate = [NSPredic...
My application links against these Frameworks:
Cocoa.Framework
AppKit.Framework
CoreData.Framework
Foundation.Framework
Note that OpenGL.Framework is NOT linked. However, after setting DYLD_PRINT_LIBRARIES=1, I note that:
...
dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
dyld: loaded: /Syste...
I have a database with the current coordinates of every online user. With a push of a button the user can update his/her coordinates to update his current location (which are then sent off to server). The app will allow you to set the radius of a circle (where the user is in the center) in which you can see the other users on a map. The ...
I have developed an app that runs perfectly on OSX 10.6 but it gives some error on OSX 10.5. It basically accepts some information from user and stores it on HDD using file handeling. Now I get everything as expected but the file handeling part. i have applied if then else and using NSAlertpanel to check if file is successfully created o...
I like the way Kaleidescope does it in its "Text Scope". Anyone know how they did it or what they used? NSTableView, NSTextView?
...
It was kind simple in other OS. I just got mouse movement x and y and redraw my character, however I do not see mouse event in Cocoa. COuld somebody point on a code samples?
...
How would I do this using Objective C and cocoa using Xcode?
I am trying to insert a string at the cursor or user selection on the click of a button.
...
I am looking to inset the contents of an NSTableView so that there is a gap between the top of the table view and the first cell.
On iOS this is easy with UITableView - achieved by using setContentInset:.
...
I have an application that uses NSDocument to open files. I have an NSView in my NIB, and I'd like to set it's size according to the image opened:
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError {
NSLog("FOO");
// Load image
// ...
// Change size
[mainView setFrameSize:NSMakeRect(ima...