iphone

UIButtons don't respond to touch after set frame on autorotate

Hello in my app i have some uiButtons added as subviews to a view like in the picture below. when the user rotates the phone in landscape the views and buttons must change position to this: initially when the view is in portrait mode the buttons respond to touches. If i tilt the phone the buttons move, everything looks ok like in the...

Using the webView method, "loadRequest", do I need to worry about threading? (iphone sdk question)

Lets suppose I am creating an application for the iphone with a webView down at the bottom of the window (the other part of the screen has a button and the user can interact with it). I don't want the webView to stop the user from interacting with the other part of the UI when the webView loads a new url. From my limited testing throu...

Reference for the C methods used in iPhone development

Is there a good reference somewhere with all the C functions that can be used by default in iPhone development (I guess they lie in the Foundation framework)? I mean functions like: arc4random(), cos(), sinf(), hypot(), sqrt(), sqrtf() etc... They are so many considering their variations too (sin(), sinf()) and googling every single tim...

What are the Top 5 Languages to localize an app for?

I'm wondering, based on experience (and raw population data) which are the 5 "best" localizations for an application (iPhone app in this case). Note by localization I don't only mean language, but other customs such as date and currency formats, etc. My guess list would be as follows English French Spanish German Japanese How does y...

NStimer from NSThread

iphone project. How can i call NStimer from NSThread? I tried with no luck. ...

Using NSOperation for threading creates too many objects

I have an app that makes SOAP calls. To keep the UI from blocking, we are putting each SOAP call into a subclass of NSOperation. This works well, but we have a ton of different types of SOAP calls. So if we use 3 WSDLs each with 10 Ports or Operations, then we 30 different calls in SOAP and if we put each of those in a thread using NS...

Can I develop my own objective-C Framework for Cocoa Touch Applications?

Is it possible to create an own obj-C Cocoa Touch framework which can be used by other developers? And furthermore can you protect this framework? ...

Changing the location of a UIButton when it is clicked

Hello again, I'm putting together an app that uses a keyboard (like the native iPhone one) that has symbols on the keys. My question is how to I change the location of a button when it is clicked (as the UIControlStateHighlighted images is bigger than the regular state). Thanks for any help/pointers. ...

Strange UIButton behavior: Is that normal?

I have a simple UIButton and want to do something when the user touches it, but then moves the finger outside the button and untouches the screen. So that seems like I need to listen for the UIControlEventTouchUpOutside event. In my view controller, I did this: UIButton *bt = [[UIButton alloc] initWithFrame:rect]; [bt setBackgroundCol...

iPhone dev - NSInternalInconsistencyException help?

2009-08-19 11:00:06.482 Pickers[26090:20b] *** Assertion failure in -[UIDatePickerView _updateBitsForDate:andReload:animateIfNeeded:], /SourceCache/UIKit/UIKit-963.10/UIDatePicker.m:908 2009-08-19 11:00:06.483 Pickers[26090:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter n...

What is the best way to reuse code in different classes in Obj-C?

I have multiple classes (controllers) that share a huge chunk of code with each other. How can I factor out this piece of code? The code is some methods that belong to a protocol. In other words, all my controllers are behaving the same way with regards to this protocol. I can't make them subclasses of the same parent because they are al...

Empty "Groups" in People Picker Navigation Controller

I'm using the standard People Picker Navigation Controller to let users associate one of their contacts with one of my objects. It presents itself as a long list of ALL contacts. The back button (top left) says "Groups" but when clicked on it shows an empty screen...even when there are many Groups in the user's address book. I've read th...

Sorting toMany relationship Set in core data

I have Two models Department and Worker. Departments has to-many relationship(workers) to worker. Worker has firstName field. How can i get a worker list sorted by firstName by accessing departmet.workers? Is there any way to add sort descriptors in to-many relationship? ...

SQLite: Need Date >= (x) number of days from today

Trying to select a date (x) days from today's date, where the date would be start of day (e.g. 12:00am that day). For example, a query with date 5 days earlier.. @"select pkey, dateofmod from data WHERE dateofmod >= date('now', '? days')" , [NSNumber numberWithInt:-5]; doesn't seem to work. (using FMDB). ...

How to set the default page on the right side instead on the left (reverse) when launching App that used UIPageControl of UIScrollView?

My Case: I have original Page Control app from Apple. I would like to modify the launch of the app on right side on page control at the bottom of UIScrollView? By default, when launch - it is on the first page which is on the left. Say for example, i have 7 pages. So, I want the first page appear on the last page which is on the 7th pag...

Copying a dictionary with multiple sub dictionaries and only returning certain keys from the sub dictionaries.

In my current iPhone project, I have a created a dictionary that groups the sub dictionaries by the first letter of the "Name" key. NSLog returns the following. I would like to create an identical dictionary that only shows the "Name" key under each initial letter key. What is the best way for making a copy of some of the items in the su...

Does iPhone allow Light sensors as input?

Hi, I was just wondering whether iPhone developement allows light sensors to be used, as buttons or action elements?? I found this link online... Possible to use Light Sensor as a Button? [Archive] - Touch Arcade If anyone could shed some light on the issue, I'd appreciate the help? Cheers. Divanshu. ...

Justified Alignment in UITextView - iPhone

In my application - i have an textView with many lines, but I need the data with proper appearance .. Is it possible to have Justified Alignment in UITextView? ...

Google Spreadsheet API on iPhone

Hi All, I'm trying to add a row to an existing spreadsheet using list feed. But Every time I'm getting the following error "rror Domain=com.google.GDataServiceDomain Code=400 UserInfo=0xeddae4 "Operation could not be completed. (Blank rows cannot be written; use delete instead.)" I'm using the following code GDataEntrySpreadsheetLi...

How to correctly remove view from it's superview if no longer needed?

Apple says: removeFromSuperview Unlinks the receiver from its superview and its window, and removes it from the responder chain. (void)removeFromSuperview Never invoke this method while displaying. So before I call that, I should call setHidden:YES? Would that be enough? ...