xcode

Sqlite SELECT * for Last 7 days

Hi, Im trying to do a SELECT * to retrieve rows for last 7 days in SQLite. the table structure is as follows CREATE TABLE 'session' ('rowID' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , 'steps' INTEGER, 'stop_time' DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP) How do I do this? Im new at this ...

UIImageView ignores UIViewContentModeScaleToFill

Hi I have a UIImageView that I dynamically load with an Image using myTableViewCell.myImageView.image = [UIImage imageNamed:myImageFileName]; myImageView is a UIImageView added to a myTableViewCell.nib and declared as IBOutlet. In IB I set the properties to set the content mode to "ScaleToFill". The images are larger than the UIImag...

ASIHTTPRequest: Results are not populated at the right time when using an asynchronous request

Hello all, I've my own class which should do the request and the data processing (parsing). This class should be used from different view controllers. In this class I have implemented: - (void)sendRequest:(NSString *)url; - (void)requestFinished:(ASIHTTPRequest *)request; - (void)requestFailed:(ASIHTTPRequest *)request; - (id)parse:(NS...

How to get screen size using code?

Hi everyone, I would like to get the iphone screen size to give calculation, but I did not found any documentation how to get it. Would you please figure it out for me? Thanks ...

Practical efficient usage of IBOutletColletion

How does look the practical usage of IBOutletCollection? Unfortunately Apple documentation mentions it briefly without giving an wider idea of usage. OK, it maintains one-to-many relation with IB, but how to access and use particular objects efficiently? With TagName? How to ensure the order of objects? ...

Store preferences in a file and import values to initialize variables

Hi, I want to store the content of some variables in a file. The user nor the application should change the value. It would be great if the user cannot read the content of this file. On startup the application reads the file and initialize some (global?) variables with the content. The file should contain some values like server URL an...

LLVM 2.0 can't build for iPhone simulator. GCC 4.2 works fine.

When I build my project (any project, really - I tried creating a new empty project with the same results), it builds fine with GCC 4.2 under either Xcode4 or Xcode 3.2.4. If I build using LLVM 2.0 under Xcode4 or with LLVM 1.5 under Xcode3, I get compile-time build failures, but only when building for the Simulator. The build errors...

one XCode Project multiple iPhone apps

Hi, I tried to create multiple iPhone apps using same XCode project and that worked ok, but when I want to install all of them into my iPhone, iTunes instead of adding the second app as new, it want to replace the existing one(the first one installed) with the second one. I used for each application a different target and made a script...

Flashing UILabel as a

I'm trying to use a UIImage as a button which gives the impression of it being turned on then off again within about half a second. This works fine if I switch it on but if I want to switch it off again it doesn't switch on at all. I have a short loop in there to prevent it switching on and off so fast I can't see it but it doesn't switc...

How to define a global variable of type NSUserDefaults and initialize a value?

Hi, which is the cleanest way to use something like a global variable? Normally, using a global variable is forbidden, but I don't know a better solution for accessing NSUserDefaults from different classes. I read a bit and come up with this. I define a Contants.h and a Constants.m file and include them everywhere I need to. //Consta...

What's an easy way to manage source files that are shared among different Xcode projects?

Hello. I'm diving into iOS development and I plan to build a few basic apps that make use of my own reusable code. As I update the files that contain my reusable code, I'd like those updates to be reflected in all the Xcode projects that use them. What are some ways I can do this? Thanks in advance for your help! ...

Where can I find and change the setting that specifies the name of the iOS application?

Hello. I've created an iPhone app project in Xcode and I'd like to change the name that is displayed under the app icon, as well as in alerts, etc. By default, the name of the app is the same as the name of the project. How can I change the name of my iOS app? Thanks in advance for your help! ...

Availability.h No such file or directory

Hello, I am trying to build a pre-written app, on OS X 10.5 with the base SDK set to OS X 10.4. There are a couple of pre-compiled header files which are returning errors on compile, in CFNetwork.h where it is including Availability.h "Availability.h - No such file or directory" I checked the header path and this header is not present...

How would I create back, forward, and refresh buttons for a UIWebView programmatically?

I currently have a webview created but I do not want to use interface builder to create the back, forward, and refresh buttons. How would I create these buttons programmatically? I know how to create regular buttons with code, but as for webView delegate buttons, I am lost and have not been able to find many resources on it. ...

How do I include libxslt in my iPhone app?

I've heard that including libxslt.dylib is grounds for getting your app rejected. I don't know how accurate that is. Nevertheless, I would like to include the latest version of libxslt. I'd like to do the same thing with libxml2, as well as other libraries in the future. What is the correct way to include a code library like this in my...

uitabbarcontroller - Run code when users clicks already selected tab

I have an app with 4 tabs.. If the user click an already selected tab I was to run a piece of code.. (refresh a webview).. I managed to get the webview refreshed when a user goes to a different tab and comes back to the tab.. but I also want to refresh the webview when the user clicks the already selected tab.. any ideas? ...

Percentage Calculation always returns 0

I am trying to calculate the percentage of something. It's simple maths. Here is the code. float percentComplete = 0; if (todaysCollection>0) { percentComplete = ((float)todaysCollection/(float)totalCollectionAvailable)*100; } Here the value of todaysCollection is 1751 and totalCollectionAvailable is 4000. Both are int. But percen...

NSURLConnection or NSurl?

Hi, what is the difference between NSURLConnection and NSUrl? i mean if i am downloading a file, does it make and difference which one i use? Rgds for: NSString *myUrl = @"http://www.test.com/"; NSString *returnData = [NSString stringWithContentsOfURL:[NSURL URLWithString: myUrl]]; or NSString *myUrl = @"http://w...

Tutorial for MGTwitterEngine for Iphone

Is there a good tutorial available to use MGTwitterEngine on the Iphone? Call me dumb but I cant figure it out. All I want to do is update the users twitter status through my Iphone app. Basic Authentication is not supported any more. So how do i do this? Im looking for the easiest most simple way available. ...

Playing sound issue iPhone?

What's wrong with this code? I've used it before but now I'm getting these warnings... warning: passing argument 2 of 'AudioServicesCreateSystemSoundID' from incompatible pointer type warning: passing argument 1 of 'AudioServicesPlaySystemSound' makes integer from pointer without a cast -(void)playfireSound{ NSString *path = [[N...