iphone

Reusing a MFMailComposeViewController

I have an app that is built on the TabBar-based app in which I need to have one tab that is basically an email composer. So I'm trying to use a MFMailComposeViewController as one of the tabs. This seems to work fine until I actually go to send an email with the controller. If I do this the MFMailComposeViewController's view disappears...

How to configure UIButton to use showsTouchWhenHighlighted?

I have a UIButton that's 90x90 in size and I would like it to glow when tapped. Using showsTouchWhenHighlighted will make it glow but it's glowing out of the center of the button and for a small radius only. This might work well for a small button like the info button, but for my button size, it's not. Is there anything I can do to ma...

iPhone OS 3.0 UITextView

OK, I'm having some problem with the UITextView. Here's the issue: I add some text to a UITextView. The user then double clicks to select something. I then change the text in the UITextView (programatically as above) and the TextView scrolls to the bottom of the page where there is a cursor. However, that is NOT where the user clicked. ...

multi-view app is crashing

I have an app that has a tabBar Controller and a navBar Controller. It has ~8 views (a variety of web, table, standard, mail, address etc.), some created using IB some created using XCode to make the table views. I've ran the memory leak tester and it doesn't have memory leaks. It can crash at anytime on any of the views, If I flip ba...

[Memory leak] - Not seeing stacktrace in Instruments

Hey Guys, I am using Instruments to find memory leaks in my iPhone application. I saw a few leaks in the application however the extended details view is not showing the stacktrace. It just says "No stack trace available for this block". I am sure I have missed some settings which resulted in this behavior. Any help would be greatly ap...

iPhone OpenGL ES Texture2D Masking

What's the best choice when trying to mask a texture like ColorSplash or other apps like iSteam, etc? I started learning OPENGL ES like... 4 days ago (I'm a total rookie) and tried the following approach: 1) I created a colored texture2D, a grayscale version of the first texture and a third texture2D called mask 2) I also created a te...

Emulate/Simulate iPhone Sprinboard behavior in a JS Webpage

Hey, I am looking for a smart way to emulate the iPhone Springboard behavior of changing icon possition. I just want to change few icons on ONE screen. It should be run in JS on a webpage. Any suggestions to start? Thank you very much ...

How to fire 10 messages per second?

Problem: I need to fire values to an object 10 times per second. I must be able to start firing and stop firing. I've discovered that the delegate of an UIScrollView gets notified in about the same time intervals, no matter how fast the scrolling is. You can easily see that if you NSLog the deltas from the offset changes. There must be ...

download large video files to iPhone

Hi All, I want to download a large video file to Iphone in my app. I used NSURLConnection and saving the file to disk once it completly downloads the video. As my video is large, it is crashing in middle. Is there anyway like directly saving the file to disk without keeping it in memory. Thanks, ...

Address Book constants evaluating as zero

I have a program where for certain code paths, the address book constants (such as kABPersonEmailProperty, kABPersonAddressProperty) evaluate to their normal non-zero value. However, if I follow a different code path, all these constants evaluate to zero. Furthermore, once I follow the "successful" code path, if I take the problematic ...

callbacks inside applicationwillterminate

Hi , I am trying to post some data before my application terminates. Iam doing this by genrateing sockets using CFStreamCreatePairWithSocketToCFHost and later on I have the callbacks for reading and writing. But I am not able to post any data. It goes through all the functions but doesnot enter into callbacks. Does that make sense to a...

iPhone: How to encrypt a string

I would like to encrypt a string with AES 256 on the iPhone but have not found much via google. What I am trying to do is post some data to a web site as part of a game I am creating, but I do not want the user to be able to cheat by seeing how it is posted because it is plain text. So I want to post one encrypted string to my php page...

iPhone UIImageView Array

So I'm declaring a NSMutableArray to hold 5 UIImageViews. .h file: @interface ImageDisplay : UIViewController { IBOutlet UIImageView *img1; IBOutlet UIImageView *img2; IBOutlet UIImageView *img3; IBOutlet UIImageView *img4; IBOutlet UIImageView *img5; NSMutableArray *imageHolderArray; } @property (nonatomic, re...

Force loading/unloading a view

How can I setup a view controller to refresh the fields in the view only it is pushed on a navigation controller and releases the objects when it is popped from navigation controller views. My goal is that for a view controller: Refresh display only when it is pushed on the navigation controller stack releases data when it is popped f...

When UIButton content mode is "center," background image is pixelated.

Here's how I'm setting the background image and content mode: [btn setBackgroundImage:[[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"dots_game_horiz_blue" ofType:@"png"]] forState:UIControlStateNormal]; [btn setContentMode:UIViewContentModeCenter]; Is there a reason that the background image would be ...

My Iphone App crashes (Bad access) when turned on it's side (landscape mode).

For some reason, every time I run my Iphone App, the App works fine as long as it is upright. The second the simulator turns to the left or right (like if I manually turn it, or if it's trying to play a video), the code crashes, with either a "Bad Access" or an exception. The crazy thing is that this stuff was JUST working, and I didn't...

Disappearing my view in a really strange way using animation and a timer. How can I improve this?

- (void) hideMenu { UIView *currentView = [self view]; [UIView beginAnimations:nil context: nil]; [UIView setAnimationDuration: 0.5]; [currentView setFrame:CGRectMake(0, 480, [currentView bounds].size.width, [currentView bounds].size.height)]; [UIView commitAnimations]; self.timer = [NSTimer scheduledTimerWithTimeInterval:(....

NSMutableArray containsObject method not detecting object

// Add the button to the NSMutableArray. ... UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; [[self hBtns] addObject:btn]; ... // In another method, try to see if it exists. - (void)didPushBtn:(id)sender { UIButton *btn = (UIButton *)sender; if ([[self hBtns] containsObject:btn]) // Is false every time. ... } Why i...

How to be more memory efficient with tab bars and nav controllers?

Background: I have a tab bar controller which currently contains 4 tabs. 3 of the tabs are navigation controllers which display a hierarchy of table views for viewing, editing, and creating data. The data is generally NSStrings that are taken from the user and stored in a global variable (data needs to be accessed from multiple views in ...

Adding unique objects to Core Data

I'm working on an iPhone app that gets a number of objects from a database. I'd like to store these using Core Data, but I'm having problems with my relationships. A Detail contains any number of POIs (points of interest). When I fetch a set of POI's from the server, they contain a detail ID. In order to associate the POI with the Detai...