xcode

Xcode Obj-C Why is 7/10 not 0.7

int a=7 int b=10 float answer = (float)a/b; answer=0.699999988 ( I expect 0.7 ??) ...

iPhone/ XCode: Targeting the right iPhone OS's

Background: I have XCode 3.2.3 installed and want to distribute a project, ideally to a variety of iPhone (iPod Touch?) devices, including older ones. When choosing Project -> Build -> Base SDK I'm seeing the options "iPhone Device 4.0" and "iPhone Device 3.2" (no more 3.1.x, though IIRC it was in in the previous version of XCode, before...

XCode/Static Analyzer: Suppressing a retain count/leak warning

Hi all, I have a function that is creating a variable, but not deallocating it. It passes this object on with a message to another function that deals with the memory management. My question is how do I suppress the static analyzer warning for what XCode thinks is an over-retained variable? I thought I could use NS_RETURNS_RETAINED f...

Interface Builder doesn't work

I have a trouble with Interface builder: I downloaded the iPhone SDK 4 but Interface Builder doesn't work: when I open it, it close immediately. What can I do??? ...

"No provisioned iPhone OS device is connected" after update to 4.0

I updated my iPhone to the new OS 4.0 and went to build my iPhone app and everything built ok, but the message I got at the end was "No provisioned iPhone OS device is connected". Looking at the Xcode organiser, it shows my connected device with an amber icon next to it, and all my provisioning profiles show up as "Installed" but also wi...

iPhone SDK - instance variable out of scope issue

Hi, I am getting crazy over this error. Compiler is saying out of scope for an instance NSSString variable. Never had this thing before and used thousands of NSString instance variables! Here is my class .h file #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> #import <CoreAudio/CoreAudioTypes.h> #import "Snapshot.h" @in...

The release of Xcode 4

I'm a paid up iPhone developer. I've really enjoyed the WWDC iTunesU videos and am eagerly awaiting Xcode 4. My question is simple. When do you think Xcode 4 beta will be released to non-WWDC attending developers? I've been scouring the 'net for days and can't find any decent suggestions at all. ...

What will be the best way for creating custom container for adding components in cocoa.

I am creating custom view to add child controller like radio button,text field etc. I am sub classing NSView and overriding drawRect method to get custom drawing via NSBezierPath. but when I am clicking or focus changes for text field ,radio button. I am getting artifacts until I call setNeedsDisplay. Is there any better way to manage t...

iphone Xcode settings problems

I am going through the Apple provisioning profile walkthrough documentation to create the binary to submit to the app store but came across a very visible problem. The documentation shows that when the user clicks on the "Overview" tab in Xcode they should have a list of options such as: Device - iPhone OS 2.0, Device - iPhone OS 2.1, ...

xcode 101 - import file question

when importing a file, what does "Copy items into destination group’s folder (if needed)" mean? ...

Stanford's initial assignment not working

Hi - Stanford put out for free a series of videos and handouts for their iPhone programming course. I've played around with the first assignment, but all I get on the Simulator is a blank screen. Here's the recipe I followed; what am I missing? In Xcode, create a new Window-Based iPhone application. Open the project’s MainWindow.xib f...

[iPhone] MotionEvents reduce sensibility

Hey guys, since my question was answered really fast and with a high quality the last time I decided to post here again. After hours of trying I finally was able to implement motionEvents in my application (oddly enough I first had to create a new view where I put all my stuff in - somehow it didn't work in a modified window-controller...

Leaks (instrument) reports leaks in autoreleased objects

Update: this leak has been solved. If you are getting similar leaks and your application is multi-threading, you are most likely making UIKit calls from a background thread; make use of e.g. [NSThread performSelectorOnMainThread:] to route UIKit calls out to the main thread, which is the only place where they are allowed. I've been runn...

setup box2d for xcode ipad

I'm following this page, but the explaination it's for iphone simulator, i have the ipad simulator and the iphone os 3.2 in the xcode but when i try to follow the example and make it work for ipad get lots of errors in the box2d classes. Here it's the source: http://www.drobnik.com/touch/2010/05/physics-101-uikit-app-with-box2d-for-grav...

Which compilers and build settings must I use in order to successfully use the "Build and Analyze" command in Xcode with Clang Static Analyzer?

It seems to work pretty randomly, sometimes I get it to work, but sometimes not - and until now I never wrote down the build configurations, settings and used compiler. Which ones can I use for Clang Static Analyzer in Xcode? And are there special build settings I must set in order to make it work? ...

How do i enable code blocks in an xcode iPhone project?

I'm trying to enable code blocks in our iphone application so that i can run the static analyzer tool included with xcode. I get this warning (or error, depending on which compiler i use) when i run the build and analyze task: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Framewor...

iphone deployment version requirements

Is there a specific version that the deployment requirements need to be set to in xcode to submit an app to the app store? I keep getting a "not accepting this SDK" error when I try to upload the binary but my target deployment OSs are all recent (3.0, 4.0). ...

How to load an external php or html file into a section in my iPhone app

Trying to figure out how to load an external webpage into my iPhone app. It would be used to let people know the latest of something. Here's what I have found but I am unaware of how to use it: NSData *externalData = [NSData dataWithContentsOfURL:[NSURL URLWithString: @"http"//www.xprogress.com/time.php"]] How would I load this into...

'__glibcxx_requires_valid_range' was not declared in this scope (xcode)

I'm trying to use in an Xcode (iphone) static library, and can't figure out this error. Anyone else had this before? It borks in the file stl_algobase.h at these places: __glibcxx_requires_valid_range(__first, __last); I've tried using GCC 4.0, but it always includes from here: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs...

How to add to Interface builder classes in a static library, permanently?

Hi, all. I know the thread on http://stackoverflow.com/questions/1058766/interface-builder-cant-see-classes-in-a-static-library there add to InterfaceBuilder(IB) classes in static library, temporary. The way is drag & drop the header files(.h). It's working in one time booting the IB I wanna permanently add to IB the classes. How to d...