What's the best way to handle memory management with nested factory methods, such as in the following example?
@interface MyClass : NSObject {
int _arg;
}
+ (MyClass *) SpecialCase1;
+ (MyClass *) SpecialCase2;
+ (MyClass *) myClassWithArg:(int)arg;
- (id) initWithArg:(int)arg;
@property (nonatomic, assign) int arg;
@end
@implem...
On iPhone, how do I show a login screen to get username and password before giving access to iPhone app? Also, does the iPhone store a cookie to the secure website like a web browser?
I was thinking of giving users to my website a long API key to store in the settings of their iPhone instead of asking them to login with a username/pass...
I am using the code:
{
randomstatus=0;
msg=[[NSString alloc]initWithFormat:@"Good job, do you want to continue?"];
UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:msg delegate:self cancelButtonTitle:@"No" destructiveButtonTitle:@"Yes" otherButtonTitles:nil];
[actionSheet showInView:self....
I'm looking to have my main view shrink to reveal the next view in the same way the Facebook app's views shrink when you press the top-left button. I already have it working with one of the included animations like this:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAn...
Hi all !
I've made a ViewBased app, in the app delegate i've set a UITabBarCotntroller, in the app i have different view Controller two of them displays text in a UITextView and labels, the other one is my "ShakeController" a UIViewController in which i've set a UIAcelerometerDelegate, in it i create a instance of UIAccelerometer, in t...
Hello all, I have an array for instance,
Array {
3.0 at Index 0
2.0 at Index 1
3.5 at Index 2
1.0 at Index 4
}
I would like to get sort it in ascending order without losing the index in the first place, like this,
Array {
1.0 at Index 4
2.0 at Index 1
3.0 at Index 0
3.5 at Index 2
}
When I so...
If have a Navigation Bar and a Tab Bar in one of my views.
This is all working fine.
One of the Tab Bar items requires pushing several other view controllers on the navigation stack before I get the where I need to be.
This is also working.
When I click on the tab bar item, it marches right back up the stack.
How can I make the desired c...
Here's a tricky iPhone problem I've been working on. I have three UIScrollViews on a page, one that only scrolls horizontally, one that only scrolls vertically, and one that scrolls both horizontally and vertically. I want to lock the views together, so that the horizontal location of the horizontal only scrollview matches the horizontal...
Hi All,
Id like to start my game, with the initial game play layout as the background, with a buttons layer over the top with maybe 'Tap to start' and a high score etc.
and similarly, when the game finishes, id like to just 'pause' the final game play layout and overlay a game over menu of sorts.
I tried calling [[CCDirector sharedDir...
my UITableView have serious memory leak problem only when the NSString is NOT encoding with NSASCIIStringEncoding.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"cell";
UILabel *textLabel1;
UITableViewCell *cell = [tableView dequeu...
When I play a video with MPMoviePlayerController in my app my iPhone does not auto lock (tested OS 3.0 & 3.1.2). However, the application.idleTimerDisabled = NO, so this setting is not affected by MPMoviePlayerController.
How can I get my iPhone to sleep normally (e.g. after 3 min screen dims, then goes dark) when my app is running and ...
I'm loading a view like this:
if(commentSubmissionView == nil){
commentSubmissionView = [[CommentSubmissionController alloc] initWithNibName:@"CommentSubmissionView" bundle:nil];
}
[self.view addSubview:commentSubmissionView.view];
viewDidLoad and viewWillAppear in commentSubmissionView do not fire. Is there something else I n...
Any chance?
I want to know if it is set from "1 - 5 minutes" or set to "never".
Thank you!
...
Hey,
I created a class ServerModel for my app and in it I want to make a connection to the Sqlite database I have on the device, but anytime I go to check my NSManagedObjectContext it is returning null.
While the same work well in my other class RootViewController
In my appdelegate I am doing
rootViewController.managedObjectContext ...
How to do like that? I don't know how to do..Help me.
...
I have a need to make a UITableView only display whole cells at the top of the cell, so when the table is moved or scrolled it should animate to make a whole cell visible at the top of the table if it has happened to stop with a cell partially off the top. This can be easily done using visibleCells and scrollToRowAtIndexPath methods of U...
How can I get the text value of a segment in a UISegmentedControl?
...
Hi,
How can I use strike-through font in objective C??? More specifically in UITableViewCell
cell.textLabel.text = name;
cell.detailTextLabel.text = quantity ;
cell.XXX = ??
...
I have a plist file in my resources group in xcode. I am trying to copy this into my documents directory on app launch. I am using the following code (taken from a sqlite tutorial):
BOOL success;
NSError *error;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentD...
I've got some somewhat hefty string size calculations happening in my app (each one takes close to 500ms, and happens when the user scrolls to a new "page" in my app (like the Weather app). The delay only happens once per page, as the calculation only needs to be run once (and can even be cached for subsequent launches with the same data...