I have some code in my application that looks something like this:
char *hash = (char*) sqlite3_column_text(get_bookmark, 0);
NSString* postHash = [NSString stringWithUTF8String:hash];
This works for me every time; I've never seen it not work. Most of my users do not experience problems (as far as I know). However I find that postHash...
I am having trouble with a BOOL property and I can't quite figure it out.
I have the following set in my .h file:
BOOL myVar;
@property BOOL myVar;
Then in my .m file I synthesize myVar and have a method that set myVar=YES; and also starts a timer. The timer then calls another method that tries to read the value of myVar.
To test f...
Using Objective-C/Cocoa how do you calculate the width and height required to draw a string based on a particular font? In C#/.Net you can do it like this:
SizeF textSize = graphics.MeasureString(someString, someFont);
Is there something like that available in Objective-C/Cocoa?
...
I am talking about the navigation area on the left side of iTunes for Library and Playlists. I'm wondering if this is a built in class (which I couldn't find documented) or something custom implemented by Apple.
I'm working an a mac application where I want to include that type of navigation. I want to allow people to "fold" the catego...
I want to add some tail marks to several strings. Are there any marks like '\n' on iPhone?
...
How can I create a Installer package for iPhone ?
...
I have implemented NSXMLParser in my app and I am reviewing alternatives. My complaints about NSXMLParser are that it's convoluted to implement for simple files, and it's not the zippiest thing around either.
So far I've identified:
TouchXML
Objective-XML
Any others?
And what's your experience with these?
Thanks for your input!
...
Just picking up Objective-C 2.0 and wanted to know if there is any advantage in using the dot operator for accessing properties instead of the "old" way. Short example of what I mean.
"old" way:
[myFraction setNumerator: 1];
[myFraction setDenominator: 3];
"new" way:
myFraction.numerator = 1;
myFraction.denominator = 3;
Thanks...
Is it possible to navigate an NSTableView's editable cell around the NSTableView using arrow keys and enter/tab? For example, I want to make it feel more like a spreadsheet.
The users of this application are expected to edit quite a lot of cells (but not all of them), and I think it would be easier to do so if they didn't have to double...
The first line of code creates a memory leak, even if you do [self.editMyObject release] in the class's dealloc method. self.editMyObject is of type MyObject. The second line incurs no memory leak. Is the first line just incorrect or is there a way to free the memory?
//creates memory leak
self.editMyObject = [[MyObject alloc] init...
I'm looking for a primary source (or a really good explanation) to back up the claim that the use of autorelease is dangerous or overly expensive when writing software for the iPhone.
Several developers make this claim, and I have even heard that Apple does not recommend it, but I have not been able to turn up any concrete sources to ba...
Hi, I have got a problem with NSString.
NSString* str = [[NSString alloc] initWithString:@"Hello world"];
In the code above, do I need to release the object str? According to the rule, this object is created with alloc, so it should be explicitly released with the release method. However, I can't find any memory leaks in Instruments ...
hello, I trying to develop a game for iPhone by using cocos2d. I need DRAG option in cocos2d. Is it possible to implement drag option in cocos2d ?
...
I added a navigation control to swith between Views in my app. But some of the views shouldn't have 'Back'(the previous title) button. Any ideas about how to hide the back button?
...
Hi
im working on an iPhone application which requires communication between 2 devices through WiFi.
Can somebody please help me by providing a simple iphone application code for the same which is able to communicate data between the devices...i hv gone through the "witap application" available on the developers site but wasnt able to un...
I have a memory leak that displays UICachedDeviceWhiteColor. I'm not using UICachedDeviceWhiteColor anywhere and a search on it turns up people saying this is a bug in the iPhone-SDK. I found this blog entry:
http://piezoelectrics.blogspot.com/2009/02/uicacheddevicewhitecolor-leak-in-iphone.html
but I can't find
#import "NSAutorelea...
Simple question really; is there a difference between these values (and is there a difference between BOOL and bool)? A co-worker mentioned that they evaluate to different things in objective-c, but when i looked at the typedefs in their respective .h files, YES/TRUE/true were all defined to 1 and NO/FALSE/false were all defined to 0. ...
Hello, I am new to the iPhone SDK and am trying to create 3 views and switch between them. Data will come from a server and I will basically be showing 1 view and caching the other two. So far I am just trying to create a view and display it at run-time. My code is listed below. It shows only a blank screen and I think I am missing a key...
Extending the Utility Template
I'm working with the Xcode Utility template (Mainside/Flipside) and I need to add a new screen. I've added:
docView.xib (copy of FlipsideView.xib)
docView.m
docView.h
docViewController.m
docViewController.h
In rootViewController.h I added:
UINavigationBar *docNavigationBar;
docViewController *do...
I followed Chris Hanson's advice about debugging framework unit tests in Xcode 3.1, but when trying to run the custom executable, the program crashes, stating the below error message [substituted $(BUILD_PRODUCTS_DIR) for the real location of the build products].
2009-03-02 19:56:03.414 otest[28059:10b] Error loading
$(BUILD_PRODU...