iphone

How to get a time since string from a NSDate object?

Basically, I'm getting a date time string from an API, and I want to show in the app that this activity happened '5 hours ago' or '3 days ago', and so on... I am currently trying to get the NSTimeInterval from [NSDate timeIntervalSinceNow] method. And then converting the time interval to NSDate again using [NSDate dateWithTimeIntervalSi...

Objective c, Memory Leak, reading from sqlite and assigning values to a NSDictionary and NSAarray

I have a list of shops in a ListController file. I've setted up a sqlite db, in which i've stored 60 shops. On the top of the list i have a search bar. I've made a class called DataController, that is responsible to load and store db datas. @interface DataController : NSObject { sqlite3 *database; NSArray *shops; NSDictionary* ...

Rotate a UIImageView with a touch gesture - iphone dev

Hi all, Been having real trouble with this one and wondered if someone may have found a solution to this issue. I would like to be able to rotate a UIImageView using a touch gesture -> So when the user places two fingers on the touch area and rotates their fingers the UIImageView will rotate with them (Rotating in whatever direction ...

float is getting mangled when passing between methods (typecasting problem?)

I'm having trouble passing a float value from one object to another. It appears to be fine in the first method, but in the second its value is huge. I assume this is some kind of a problem with my typecasting, because that's the thing I understand the poorest. Help is greatly appreciated! In my game controller, I do this: float accurac...

Using Global Variables to communicate values between classes

So my simple idea is to create an app that allows the user to report their location's latitude and longitude coordinates via email. You tap the button, the email screen comes up via the MessageUI framework, the To, Subject, and Body fields are already pre-entered, all that's needed is for the user to hit "send". My problem, is that I n...

How can I change the color of a UIWindow from a separate class?

I am trying to change the background color of a UIWindow when an action is sent to the class MyController. However the UIWindow resides in the AppDelegate class so I don't have access to the variable to modify it using window.backgroundColor = [UIColor theColor]; in MyController. Here is the code for MyController.m: @implementation M...

If I build and link an OpenGL application using only OpenGL ES 1.x calls, will it still work?

I am writing an OpenGL game which will hopefuflly be for both linux and iphoneOS, I basically want to be able to build using the OpenGL ES 1.5 headers and run it on my linux desktop. Can I do this? IE, I want to only use the subset of API calls common between OpenGL and OpenGL-ES. Doing the above and linking with normal libGL.a from my ...

how to get touchesMoved events more frequently?

I'm tring to track a user touch moving across the screen, but at times my app receives touchesMoved:withEvent: with locations far apart, even by 70 pixels. I'm keeping the runloop fairly fluid, but I have CoreAnimation somewhat under pressure. I'm puzzled because I'm noticing the same problem even on the simulator. ...

Select tableview row programmatically

How do I programmatically select a tableview row so that - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath gets executed? selectRowAtIndexPath will only highlight the row. ...

loginview problem in tabbar application.

i have a 3 tabbar in my app. in my Appdelegate i have a reference to loginview where i am popingup loginview if user is not logged in.here is method. - (void)LoginView { loginView = [[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil] autorelease]; UINavigationController* nav = (UINavigationController*)[tabBarControl...

iPhone - NSDateFormatter

Hello! I have a String with a datetime format: "YYYY-MM-DD HH:MM:SS". I use this in my source code: NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; [formatter setDateFormat:@"%e. %B %Y"]; NSString *test = [formatter stringFromDate:@"2010-01-10 13:55:15"]; I want to convert from "2010-01-10 13:55:15" to "10...

How many touches can be detected at once by the iPhone?

How many touches can be detected at once by the iPhone? ...

Creating NSDecimal

I am carrying out a number of calculations using NSDecimal and am creating each NSDecimal struct using the following technique: [[NSNumber numberWithFloat:kFloatConstant] decimalValue] I am using NSDecimal to avoid using autoreleased NSDecimalNumber objects (if the NSDecimalNumber approach to accurate calculations is used). However it...

iphone navigationController wont display unless i access .view

Hi, When i create a iboutlet to my navigationController and try to add it to the currentview it isn't showing anything. Its really strange, when i initialize my navigationController in code and then add it to the view it works perfectly. It even works when i make one in the mainWindows.xib and add it to the view in my applicationDidFin...

What part of the iPhone SDK handles bluetooth?

I'd like to be able to send data to a Mac with bluetooth from an iPhone? Is this possible? I think GameKit allows you to connect two iPhones, but I can't see anything about connecting to computers. ...

Strange issue with UITableViewCell: UILabel turns into something else?

I got this strange issue while working with iPhone SDK 3.1.2. My UITableViewCell contains 3 UILabel, each of which is assigned a numeric tag from 1 to 3. The problem is with the first UILabel (highlighted in the above screenshot): I am unable to set its text to anything. Even NSLog its content gives me a (null). What's interesting i...

Manually Generate URL for Rails App (for the create action)

I'm working on an iPhone app and I need to figure out how to properly nest the information in the URL (really a POST body) in order for rails to recognize it as an object hash such as: Parameters: {:student => {:name => "Bob", :age => "13"}, :user_credentials=>"..."} I've tried the following two ways and neither work for me: /studen...

NSString: newline escape in plist

I'm writing a property list to be in the resources bundle of my application. An NSString object in the plist needs to have line-breaks in it. I tried \n, but that doesn't work. What do I do to have newlines in my string in the plist? Thanks. ...

About creating vertical tab-based iPhone app.

I just want to figure out how to create vertical tab-based app like this one. Tab is generated dynamically when you push the add button. My guess is UIImageView(UIButton attached?) + UITableView as a set of component? But the whole tabs are scrollable. Any idea? Thanks in advance. Ref image link: https://devforums.apple.com/servlet/Ji...

Preventing sleep in Titanium for iPhone

I'm trying to read the accelerometer for a longer period of time (between one and two hours). However, when the iPhone goes to sleep and locks, the reading of the accelerometer readout is paused. My setInterval timer seems to be running fine though. I can also play sounds. I see two solutions a) Find a way to read the acceleromete...