iphone

iPhone SDK - Play Audio/Video through UIWebView

Hello everyone, I want to know if I could play a mp3 file or mp4 (video) file through an UIWebView by loading a simple url request. I have already tried sending the UIWebView to a video link (e.g. http://google.com/blah.mp4) but it will flash a quick QuickTime logo and show a black screen. However in MobileSafari it streams fine. Is the...

How to remain the old visible cell's position after inserting new cells at the top of the UITableView

Suppose I have a table view, and I want to implement something like this: The table view contains n cells by default. New cells will be added at the top(head) of the table view. The data source of the table view is a mutable array. The problem is when I use [tableview reloadData], the new data is always shown at the top of the tablev...

iOS initWithCoder/decodeObjectForKey memory leak

The Leaks instrument tells me that I have a memory leak when I use decodeObjectForKey within initWithCoder. For example: Class.h { MyObject *myObject; } @property (nonatomic, retain) MyObject *myObject; Class.m @synthesize myObject -(void)dealloc{ [myObject release]; [super release]; } -(id)initWithCoder:(NSCoder *)decoder{ i...

Crash when accessing a NSMutableArray member variable

I'm having some trouble with a NSMutableArray. I'm sure i'm doing something wrong with the allocation of the NSMutableArray but it's not obvious to me being an iPhone newbie. When i run the code below i can add the object MyObject to the array objects_ and set the name etc. The NSLog displays the correct data. But when i try to access t...

Need to find out who is retaining an NSMutableArray

I have an issue where I need to find out what objects are retaining a NSMutableArray. If it is an object I created I can just override retain and release and set a breakpoint on it, but since it is a NSMutableArray I can't. I tried to subclass NSMutableArray but I get exceptions when I try to add to my subclass. Any ideas? I know you sh...

Determine when a UIMenuController is dismissed?

Is there a way to determine when a UIMenuController has been dismissed? I have a (non-editable) text area I'm highlighting when the menu is brought up, and I'd like to un-highlight it when they either select an item (easy) or cancel (not possible?) ...

Read and write file in iPhone

Hello, How to make file read/write operation on iPhone?which is the path i need to specify to save the file? how can i get the current working directory in iPhone? Thank You ...

iphone: Caching an NSMutableArray?

I'm currently writing a Twitter client for iPhone and need a way to cache the public timeline. The data fetched is stored as 'Status' objects in an NSMutableArray. The NSMutableArray stores 20 objects at a time. What is the best way to do this? ...

Setting an NSDate to specific date, time and timezone

I need to set a NSDate to a specific date, time and timezone for an iPhone App. The example code below works fine on iOS 4 as the setTimeZone was introduced with iOS 4. How could I easily set a NSDate to a date, time and timezone without using setTimeZone so it can be used on iOS 3.0 devices? NSDateComponents *comps = [[NSDateComp...

How to recognize one item belong to which group when load a plist file?

Hello everyone I use codes below to load plist file NSDictionary* tSetDict = [NSDictionary dictionaryWithContentsOfFile:plistPath]; NSArray* prefs = [tSetDict objectForKey:@"PreferenceSpecifiers"]; // Iterate through dictionaries to find required value for (NSDictionary* setDict in prefs){ //......... } } I hope...

Reading data from server script using URL

I am calling a login script on the server using http call from iphone. the script returns a string "Invalid" or "valid" based on given username/pswd. Here is what I am using: NSString *myurlstr = [[NSString alloc] initWithFormat:@"http://www.mysite.com/iph/login.aspx?username=%@&password=%@",uname,pswd]; NSString *resultstr = [NS...

Presenting a UIDatePicker modally

Hey I have a view that has a button that when pressed should modally present a UIDatePicker. I have the picker showing up properly, but because it is on its own UIView, it is full height, and looks funny. All I want is to get a really quick date input from the user, more like a UIActionSheet than a UIView. How can I make the UIPicker sl...

how to get SSID information from iphone

i want to track the SSID of my nearby access points and based on that check their signal strength i have seen reachablity but i dont know how to get SSID ...

iPhone 4 - high resolution images are blurry

Hey all, I am updating an app to have high-res images to be displayed on the new iPhone 4. My original images (in a UIImageView) were 100 by 100 pixels, so I updated my new images to be 200 by 200 pixels. I know about the @2x convention, but my images are not stored locally in my project - they are retrieved from the web and being used ...

Download UIWebView page to folder.

So I have a UIWebView. When it reaches a certain webpage I want it to save that webpage in my resources folder. How can I obtain this goal. Please note It has to be saved threw the UIWebView due to cookie reasons. Its an XML file that you can't access unless you are logged in. ...

Adding Event Kit.Framework results in 1000+ Errors When Deployed to Device!

Hi, I need to add a calendar event to the user's Calendar when they click a button. This works in the simulator, but when I attempt to deploy to my 3GS running iOS 4.01, XCODE throws 1000+ errors! Any ideas? Thanks! Jason ...

can we change iphone profiles from silent to ring with iphone sdk?

can we change iphone profiles from silent to ring with iphone sdk?for eg.if the iphone is in silent mode and if some person calls the user more than 4 times then the iphone mode will change to ringing mode ............i know that there are no api for this but can all ou give some other legal alternatives , ...

multiple HTML in Phonegap applications

Can we have multiple HTML files in Phonegap application? ...

How to display the large text if this method "titleForHeaderInSection" returns in iPhone sdk?

Hi Guys, I am unable to display the total information if the results are nil in iPhone. -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if ([customerList count] == 0) { return @"Could not find any doctor with your search. Please try again."; } return @""; } I Declare...

Hide keyboard but show cursor

How can i hide keyboard but show cursor for textfiled? ...