I tried to make a private property in my *.m file:
@interface MyClass (Private)
@property (nonatomic, retain) NSMutableArray *stuff;
@end
@implementation MyClass
@synthesize stuff; // not ok
Compiler claims that there's no stuff property declared. But there's a stuff. Just in an anonymous category. Let me guess: Impossible. Other sol...
Is there a way in Objective-C to search an array of objects by the contained object's properties if the properties are of type string?
For instance, I have an NSArray of Person objects. Person has two properties, NSString *firstName and NSString *lastName.
What's the best way to search through the array to find everyone who matches 'Ke...
I've created a custom view that loads its content from a nib, like this:
/* PricingDataView.h */
#import <UIKit/UIKIt.h>
@interface PricingDataView : UIView {
UIView *contentView;
}
@property (nonatomic, retain) IBOutlet UIView *contentView;
@end
/* PricingDataView.m */
#import "PricingDataView.h"
@implementation PricingDataView
...
Is there a nice way to do this in Objective-C, or do I have to write my own tedious logic?
I'm creating and destroying a little of little state objects per frame in an iPhone game. It would be nice if I could just reuse objects from a pool.
...
Is there a simple way to package a plist object (NSDictionary, NSArray, etc.) and Post it to a web service?
...
Hello,
I have been solving a lot of memory leaks but have been unsuccessful in solving this one. There are tons of NSCF memory leaks coming due to [NSCFString substringWithRange:]. I have been checking all the String allocations and have released all of them at appropriate places. The responsible library: Foundation.
Has anyone encoun...
i.e. would cause the object to be released immediately and not have to be released by the pool if I did this?
[[NSArray arrayWithCapacity:100] release];
Can't find a clear explanation in the docs about this.
...
hi,
i recently got three20 integrated into my app and am trying to override the default toolbar color in TTWebController.
In TTWebController.m:118 I see that this is setting the toolbar's tintColor:
_toolbar.tintColor = TTSTYLEVAR(toolbarTintColor);
So I created my own stylesheet that subclasses TTDefaultStyleSheet and overrides too...
I am able to successfully get the SID (SessionID) for my Google Reader account. In order to obtain the feed and do other operations inside Google Reader, you have to obtain an authorization token. I'm having trouble doing this. Can someone shed some light?
//Create a cookie to append to the GET request
NSDictionary *cookieDictionary ...
Hello everyone,
I'm very frustrated with this problem. After one week of waiting my universal iPad app has been rejected because "is crashing on launch on iPad running iPhone OS 3.2 and iPhone 3GS running iPhone OS 3.1.3 and Mac OS X 10.6.2."
Unfortunately I can't replicate the problem, I've tested in debug and release modes and the ap...
I have a UITableView that is populated with cells of a variable height. I would like the table to scroll to the bottom when the view is pushed into view.
I currently have the following function
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[log count]-1 inSection:0];
[self.table scrollToRowAtIndexPath:indexPath atScrollPosition...
I wonder about Objective-C style.
I have FooClass.[hm] that depends on BarClass.[hm] for its implementation (though not for its interface). I can #import "BarClass.h" either directly in FooClass.m or indirectly through FooClass.h. I wonder about the common choice for this.
...
Hi, I think this is a relatively simple question, but I don't precisely know what's happening.
I have a method that tries to build a string using NSString's stringWithFormat
It looks like this:
NSString *line1 = [NSString stringWithFormat:@"the car is %d miles away", self.ma];
In the above line "self.ma" should be an int, but in my ...
Currently, we are defining ourselves an extended log mechanism to print out the class name and the source line number of the log.
#define NCLog(s, ...) NSLog(@"<%@:%d> %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], \
__LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
For example, when I call NCLog(@"Hel...
I've been trudging through some code for two days trying to figure out why I couldn't fetch a global NSMutableArray variable I declared in the .h and implemented in .m and set in a the viewDidLoad function.
It finally dawned on me: there's no such thing as a global variable in Objective-C, at least not in the PHP sense I've come to kno...
I'm using sqlite for the persistent store, so could I just upload the .sqlite file to, for example, Amazon S3 as a way of providing users with the ability to backup their app data?
Then for restoring just download it back and replace the existing .sqlite file in the app's folder.
Does anybody see any issues with that? Has anyone done it...
Hi all,
A user of my app out in the field seems to having bad crash-at-app-start issues. I got him to send me the .crash files from his PC. After "symbolicating" them according to this article, I get what looks from the stack like a unrecognized selector fail. But the top line of code corresponding to my process is an unambiguous message...
Which is the quickest way to view the value of a NSCFString variable in debugger window?
As for NSString, the string value is automatically displayed in the window or you move your mouse over it. But for a NSCFString, I tried same but cannot find the internal string.
...
So I came from a Flash background where I can animate in timeline. I've completed the Beginning iPhone Development book and just realized that I still don't know how to get an animation in. I'm guessing I need to import png sequences?
Can anyone point me to an appropriate place to learn more about this topic? I want to make a game and ...
Update: Unfortunately the help offered below did not solve my problem of sharing a class property across functions. Can anyone else suggest a possible problem? Here's the latest code:
Header .h:
@interface FirstViewController:UIViewController <UITableViewDataSource, UITableViewDelegate, UITabBarControllerDelegate> {
NSDictionary *sect...