objective-c

ObjC - Hiding the separator lines of a UITableView on iPhone

I try to do this with following line: tableView.separatorStyle = UITableViewCellSeparatorStyleNone; and it works! on the simulator.. strangely when I run the app on the iPhone (3Gs) they show up again. Any ideas why this could be happening? (Also labels and images of my custom cells are displayed on wrong positions, maybe its the sa...

Objective-C supertype polymorphism

Hi, I'm fairly new to Objective-C and wondering if it's possible to type objects as their supertype without receiving compiler warnings when assigning them, or if there is a recognised way of achieving the same thing? I realise that this is what type id is for but I have a base class with synthesized properties and if I try to use id ...

if my retainCount is 4 is that bad for iphone

Updates code - (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar { mytimer3=[NSTimer scheduledTimerWithTimeInterval:.03 target:self selector:@selector(show) userInfo:nil repeats:NO]; NSLog(@" search is down"); //////////// rnd to hold keyboard //ovController.view.backgroundColor = [UIColor ...

Problem with class_getInstanceSize

I have my class derived from UITabBar: @interface MyTabBar : UITabBar @end @implementation MyTabBar @end Further, in my code, I call class_getInstanceSize for my class and system UITabBar class: size_t origSize = class_getInstanceSize([UITabBar class]); size_t mySize = class_getInstanceSize([MyTabBar class]); I use iOS SDK 4.1. ...

MVC model design?

I have just been reading about the MVC design pattern for Cocoa-Touch applications and it suggested using a property list for the model. My question is if you needed to do some calculation on the data in the property list where would the code for that calculation go? In the past I have used a singleton object for my model and then used ...

Objective-C NSArray

I'm new to Obj-C and iPhone SDK. The test application I'm stock with is a color switcher containing two buttons ("Back", "Forward") and one text label. The idea is to switch between rainbow colors (background) and setting an appropriate text label in a cyclic manner. I declared NSArray (which is to contain colors names) in RainbowViewCo...

UITableViewCell with all subviews disappears

I placed UITableViewCell with UITextField as UITableView's tableHeaderView in Interace Builder. When I start editing text in UITextField, UITableViewCell with UITextField disappear. They even disappear when compiling this xib in Interface Builder. Any possible solutions? ...

how to access value of selected row tableview?

hi all, I am new to objective-c and i have created a application in which there is registration page.In this i have country option which is selected by user from tableview in next page.After selecting from tableview that country name should appear in country textfield on previous page.I am saving that country name in global vari...

Troubles with NSString writeToFile

I am using the following code to open a file's contents and save it to another file. when it runs the original file length is 793 but the saved file is 0. I have also tried just to copy the file. Nothing seems to work. Is there some kind of permissions I'm missing on the documents directory? NSError *error; NSString *basePath = [...

Is iPhone Proximity detection possible with Bluetooth?

Hi everyone, Would it be possible to fill a building with 20 - 30 bluetooth devices that act as proximity detectors and write an app that can calculate location in the building based on distance from the current detected sensors. I've looked at the GameKit API, but I don't see anything about calculating distance from devices. Can some...

Unused IBOutlets leaking

So, I'm loading by XIB file and it contains a set of UIBarButtonItems. Some of the items are used when the viewDidLoad: is called. @interface MyViewController : UIViewController { IBOutlet UIBarButtonItem *addButton; IBOutlet UIBarButtonItem *editButton; IBOutlet UIBarButtonItem *doneButton; } // NB: There are no properties ret...

How to get the Battery Charge Level specifically in mWh (not percentage) for Mac (Cocoa or C)

Hello Everyone, The title pretty much explains it all. I'm creating a mac app and I need the battery charge level specifically in mWh (not percentage). Would like to do it in C or Objective C preferably. Thanks! ...

connecting all benefit of facebook to iphone

hi sir , hello sir I need help to connect all benefit of Facebook to my iphone.The benefit is publishing story on wall and friends' home page. I done this think .But in 1st I connected with the Facebook and publish the comment go back to the story page or songs page and want to publish the comment on story or song on the wall. Here ...

File Permissions On The iPhone Simulator

Are the permissions for the iphone/ipad simulator different from the device itself? I only ask because I'm experimenting with file I/O, and creating and then writing to my own temporary file fails, but creating and writing to, say, the Desktop on my Mac (from the iPad simulator) is completely okay. Am I doing something wrong with my tem...

Change iphone settings based on device capabilities

Is it possible to hide certain application settings in standard Settings application based on current device capabilities? For example user can choose whether to show compass calibration UI or not, but I don't want to show this setting if device does not have a compass (e.g. iPhone 3g). Well, I think that is not possible actually but m...

How to change aspect ratio of a QTMovie/QTMovieLayer

Hi How can i change the aspect ration of QTMovie/QTMovieLayer dynamically. Say change the aspect ratio to 1:1, 16:10, 16:9, 5:3 etc ...

Doxygen/Objective-C : how can I make constants that are declared outside the class definition show up in the class docs?

Hi, I'm using Doxygen to document some Objective-C code. I have some constants declared outside the class definition. I want these to show up in the class docs. How can I make doxygen include them? (Using \file just shows them in a separate documentation page). #import blah blah /** * This is my constant */ extern NSString*constant...

iPhone universal static library works in Interface Builder in Release config but not in Debug

I followed the instructions here to create a static library of an iPhone class library. I built it in release mode. When I include it in another project, reference one of the classes in Interface Builder and run it in the simulator, I get an error if I run in Debug mode but it works in Release mode. I get the following error using the D...

UITextView.text property doesn't update first time, and then clips or doesn't display when it does

I'm trying to get the contents from a dictionary into a UITextView. The dictionary contains molecular masses paired with percentages, for example: 24 -> 98 25 -> 1.9 26 -> 0.1 I have an NSArray containing the keys from the dictionary, sorted in ascending order. So, here is my code to generate the string to set as the textField.text pr...

iPhone Menu UIView

Whats the best way to create a menu for my application now that it's already partially complete? The application basically consists of a navigation controller and drill down table. I want to create a view above the navigation controller with a couple buttons that the user could also return to by touching a button somewhere on the nav bar...