iphone

Does querying a database cost a lot of memory?

Hi there, I have this code which checks whether a file exists, and if it does it queries the sqlite database to make sure there is an entry. It is used in the method cellForRowAtIndexPath in a UITableViewController. Basically for each video that is listed in a Table I need to find if it EXISTS AND IS IN THE DATABASE. Will this cost a l...

Unable to open database file - sqlite3?

Hi All, When I am trying to sqlite database in iPhone I got one error.. "Unable to open database file" So anyone please tell me what are the main causes for this error?? Regards, Syam ...

How To Reload data from URL ???Only Can Load data in viewdidload ???

OK,First this program can load plist from URL by this code,and I put this in - (void)viewdidLoad{ NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.envolab.com/envotouch/ios_status_req_test.php"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; NSU...

Objective C: [MyObject alloc] now crashes under iOS SDK 4.1

I'm working on an existing, large-ish codebase, and after upgrading the iOS SDK to 4.1 I am now seeing very strange behaviour. The crux of the matter appears to be a particular class that will no longer alloc - it is throwing a bad access in obj_msgSend, and seems to be the Class object on the stack that objc_msgSend doesn't like - altho...

iPhone app crashing on local notification

This is weird. My application schedules local notifications whenever it is sent into the background, and while the first notification is being displayed correctly, as soon as the one after that should be fired, the whole application crashes. Yes, in the background. While no code is being executed. No console output is given, I just get ...

Error while posting duplicate message in Twitter(MGTwitterEngine)

Hi, I am using MGTwitterEngine for iPhone to support twitter, I am getting error(403) while posting a message second time how to handle this issue. That is.. Let the message is "what are you doing" I am posting using [mTwitterEngine sendUpdate:"what are you doing"] for first time it is posted successfully, if i want to post the same...

how can i create array of buttons

hi i am new to iPhone.what i did is creating a 4 buttons individually.i need button tag values.when ever i check it in console i got 0 for 4 buttons,because i create 4 individual buttons .But i need buttons tag values like for first button, tag value 0,for second button, tag value 1.... like this how can i done this pls post some code.Th...

Implementing horizontal scrolling in a UITable (row by row) for iPhone

As per the question, I'm looking to implement a video selector with different categories. This would be very similar to the BBC app in approach. I don't seem to be able to find anything that fits the bill though, has anyone got any good ideas for how I might be able to do this/an API freely available that does it. See example: http:/...

Safely dealloc'ing a Timer

I create a timer in my ViewDidLoad method of my view-controller. NSMethodSignature *sgn = [self methodSignatureForSelector:@selector(gameLoop:)]; NSInvocation *inv = [NSInvocation invocationWithMethodSignature: sgn]; [inv setTarget: self]; [inv setSelector:@selector(gameLoop:)]; NSTimer *t = [NSTimer timerWithTimeInterval: 1./30. ...

NSDate for first day of the month

This is quite a simple concept, but as of yet I have been unable to find an elegant (and calendar locale independent) solution. I need to find the first day of the month for an arbitrary NSDate. For example, given an arbitrary NSDate (arbitraryDate) another NSDate object will be returned (let's call this firstDayOfMonthDate) which repres...

Disallow UIScrollView from catching subviews touches

I've got a UIScrollView covered with a custom UIView which desperatly needs to listen to all the touch events that happen inside of him. At first, all I was getting was touchesBegan: and touchesCancelled: events. No touchesMoved:, no touchesEnded:. In fact, all the dragging gestures where being canceled by the above UIScrollView. This w...

Upgrading xcode loses simulator option

Due to other issues I was having in my project I decided to upgrade my xcode to XCode 3.2.4 iOS SDK 4.1. Now I no longer have the option to pick simulator but instead when I choose 'Device' it deploys to the Simulator!!! Under 'Project Settings I can select 'Base SDK' as either device or simulator. I tried uninstalling XCode full and r...

iPhone simulator screen problem

Well, this may be silly (i am a noob mac user). But looks like, I have messed my simulator up by pressing some (yet) unknown keyboard shortcut. My iPhone simulator now looks like this: The problem is the outer window. I don't want that. It really bugs me while taking screenshot. How to make this outer-window-less? Any idea? Thanks in ...

Do I need to release the context returned from UIGraphicsGetCurrentContext()?

I am using CGContextRef. UIGraphicsBeginImageContext(self.drawImage.frame.size); CGContextRef context=UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context,0.0f,0.0f,0.0f,1.0f); UIGraphicsEndImageContext(); CGContextRelease(context); Do I need to call CGContextRelease(Context); in the above one. ...

how can I download a PDF document from the web to my iPhone apps Document folder?

How can I download a PDF document from the web to my apps Document folder? I want to grab a version of a PDF from the web as an application is launched and use this in the app. It will need to be copied to the Apps Documents folder so it can be used from there until the app is launched again. Obviously I will need to check the date stam...

Define custom User-agent header in the HTTP request?

I would like to get a glimpse of web-sites created for iPhone devices. In order to be able to view those sites I have to modify the User-agent header in the HTTP request that my browser sends. That way I can trick the web-server into believing that my browser is an iPhone browser, and then the web-server would send my the iPhone version ...

Core Data: Fetch via specific property (join relationship)

I have an core data model as follows The attributes property of Page is a set of DictionaryEntry, they are values for my Page objects, much like a standard NSDictionary (except all of the keys and values are strings) I have a Page that has a DictionaryEntry with key="title" and value="Home". How would i form a fetch request to load t...

UIButton in UITableView problem

Hi I am trying to create a list of options with check boxes. I am using UITableView and adding custom type buttons to the table as check boxes. My code for cellForRowAtIndexPath method is pasted below. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier...

Is Ruby on Rails solution to async notify iPhone app of updates?

I starting to investigate whether Ruby-on-Rails will help solve my problem in some way? In short, I have a legacy Linux system and application which is reading and writing a collection of images. This application also uses a sqlite database to help refer to correct image files when required. What I'd like to do is have an iPhone and/or...

what is the difference between iphone device UDID , iphone device ID and iphone device Token ??

what is the difference between iphone device UDID , iphone device ID and iphone device Token ?? Normally iphone device token is used when we are using apple push notification service. But my goal is to just identify unique iphone device ? So which of the above 3 is unique for iphone device ?? ...