Re: Calling a Cocoa library from C

2011-11-11 Thread lbland
hi- On Nov 11, 2011, at 8:49 PM, Nathan Sims wrote: > I'm unclear on how to architect this. Can a C function invoke Objc methods? yes, however you should note that: Cocoa is not Objective-C and technically you can not call Cocoa from C and expect the right thing to be done, unless ... ... if

Re: 2 itunesconnect questions

2011-11-11 Thread April
On Nov 11, 2011, at 7:14 PM, Conrad Shultz wrote: > On 11/11/11 4:59 PM, April wrote: >> Years ago I used my real name. I was very new to cocoa (this is like >> 2002) and asked some dumb questions. I got flamed to death. > > Greetings, April. I regret that you were mistreated in the past; I am

Re: 2 itunesconnect questions

2011-11-11 Thread Glenn L. Austin
On Nov 11, 2011, at 1:26 PM, Conrad Shultz wrote: > On 11/11/11 1:21 PM, Glenn L. Austin wrote: >> Set your iOS Deployment Target to iOS 4.3 and build ARMv7. > > I don't think the OP said that the app should be version restricted. > Why target 4.3? 4.3 only runs on ARMv7, so it's one way to limi

Re: How to determine if there is an internet connection available?

2011-11-11 Thread Conrad Shultz
On 11/11/11 6:39 PM, Vojtěch Meluzín wrote: > Hi, > > I'm using BSD sockets for some internet access, it works fine. But if there > is no connection available, it waits for say 30 seconds completely stopping > the application. Is there a way to determine if there is actually an > internet connecti

Re: NSDateFormatter -initWithDateFormat:: vs. -init

2011-11-11 Thread Charles Srstka
On Nov 11, 2011, at 7:41 PM, Greg Parker wrote: > On Nov 11, 2011, at 5:36 PM, Jerry Krinock wrote: >> NSDateFormatter documentation indicates that >> -initWithDateFormat:allowNaturalLanguageString: is the recommended >> initializer for new designs, and furthermore that -init is not "available"

How to determine if there is an internet connection available?

2011-11-11 Thread Vojtěch Meluzín
Hi, I'm using BSD sockets for some internet access, it works fine. But if there is no connection available, it waits for say 30 seconds completely stopping the application. Is there a way to determine if there is actually an internet connection, so that I can check before using sockets? Thanks, V

Re: Calling a Cocoa library from C

2011-11-11 Thread Charles Srstka
On Nov 11, 2011, at 8:22 PM, Wim Lewis wrote: > On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote: >> Newb question. I need to create an OS X Cocoa library that is going to be >> called from a C program. The C program's interface will be simple, along the >> lines of: >> >> retval=get_float_data(&

Re: Calling a Cocoa library from C

2011-11-11 Thread Wim Lewis
On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote: > Newb question. I need to create an OS X Cocoa library that is going to be > called from a C program. The C program's interface will be simple, along the > lines of: > > retval=get_float_data(&float1,&float2); > > where get_float_data() is a fun

Re: 2 itunesconnect questions

2011-11-11 Thread Conrad Shultz
On 11/11/11 4:59 PM, April wrote: > Years ago I used my real name. I was very new to cocoa (this is like > 2002) and asked some dumb questions. I got flamed to death. Greetings, April. I regret that you were mistreated in the past; I am confident that will not occur now. Anyhow, did you get a c

Re: Calling a Cocoa library from C

2011-11-11 Thread Greg Parker
On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote: > Newb question. I need to create an OS X Cocoa library that is going to be > called from a C program. The C program's interface will be simple, along the > lines of: > > retval=get_float_data(&float1,&float2); > > where get_float_data() is a fu

Re: Calling a Cocoa library from C

2011-11-11 Thread Dave DeLong
Here's a hint: What does every main() function do in every iOS and Mac app? Dave Sent from Jane On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote: > Newb question. I need to create an OS X Cocoa library that is going to be > called from a C program. The C program's interface will be simple, alo

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Don Quixote de la Mancha
On Fri, Nov 11, 2011 at 5:25 PM, Greg Parker wrote: > Did you actually write the minimal test you described? If you had, you would > have discovered that setrlimit(RLIMIT_DATA) does not limit malloc memory. > > That's one reason why we ask bug reports to include test cases. To call setrlimit() w

Calling a Cocoa library from C

2011-11-11 Thread Nathan Sims
Newb question. I need to create an OS X Cocoa library that is going to be called from a C program. The C program's interface will be simple, along the lines of: retval=get_float_data(&float1,&float2); where get_float_data() is a function that resides in the Cocoa library and invokes Objc co

Re: NSDateFormatter -initWithDateFormat:: vs. -init

2011-11-11 Thread Eeyore
I think there was a similar discussion on this list earlier this year (maybe late last year). IIRC, the conclusion was that "init" was removed from the documentation since it is inherited from its superclass' superclass (NSObject) and doesn't do anything exceptional in NSDateFormatter, however i

Re: NSDateFormatter -initWithDateFormat:: vs. -init

2011-11-11 Thread Greg Parker
On Nov 11, 2011, at 5:36 PM, Jerry Krinock wrote: > NSDateFormatter documentation indicates that > -initWithDateFormat:allowNaturalLanguageString: is the recommended > initializer for new designs, and furthermore that -init is not "available" > after 10.5. The documentation is wrong. -[NSDateFo

Re: NSDateFormatter -initWithDateFormat:: vs. -init

2011-11-11 Thread Dave DeLong
I think you've misunderstood the documentation. -init is the preferred method for creating 10.4+ date formatters. http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDateFormatter/initWithDa

Re: 2 itunesconnect questions

2011-11-11 Thread April
Hmm It's difficult to argue with numbers like this, and of course I am guessing that a noticeable divot in sales really isn't there unless I actually do write the next angry birds... Of course based on their ratio, I'll have to write another 23 applications before I have a hit of that magni

NSDateFormatter -initWithDateFormat:: vs. -init

2011-11-11 Thread Jerry Krinock
NSDateFormatter documentation indicates that -initWithDateFormat:allowNaturalLanguageString: is the recommended initializer for new designs, and furthermore that -init is not "available" after 10.5. However, I find kind of the opposite: -initWithDateFormat:allowNaturalLanguageString gives unex

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Greg Parker
On Nov 11, 2011, at 5:02 PM, Don Quixote de la Mancha wrote: > A colleague of mine reports that calloc() works correctly on his > iPhone 3GS, in that it always returns NULL when he allocates too much > memory. He is then able to back out of all the allocations and exit > his minimal test case App

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Greg Parker
On Nov 11, 2011, at 5:02 PM, Don Quixote de la Mancha wrote: > My bug report suggested that Apple more-accurately simulate the memory > available on physical devices by calling the setrlimit() system call > just before entering main() in simulated Apps, but in all this time, > Apple's only response

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Don Quixote de la Mancha
Ladies and Germs, A colleague of mine reports that calloc() works correctly on his iPhone 3GS, in that it always returns NULL when he allocates too much memory. He is then able to back out of all the allocations and exit his minimal test case App without it getting killed by the system. I suspec

Re: 2 itunesconnect questions

2011-11-11 Thread April
Years ago I used my real name. I was very new to cocoa (this is like 2002) and asked some dumb questions. I got flamed to death. I began using a man's name shortly there after and dumb questions did not receive even remotely the same hostility. (Admittedly some though) I started using that fake

Re: How does LaunchServices decide which version of an app to open?

2011-11-11 Thread Richard Somers
This can be very confusing but I think it goes something like this. The default application launched is the version with the highest CFBundleVersion where CFBundleVersion is a monotonically increasing string, comprised of one or more period-separated integers. In the Xcode 4 target summary CFBu

Re: 2 itunesconnect questions

2011-11-11 Thread Conrad Shultz
On 11/11/11 2:02 PM, Development wrote: > Well your average dolt that jailbreaks and knows absolutely nothing > about it would be blockaded. It's the folks that have hex editors and > the time to figure it out that will find it easy. Which is still a > little too much for many JB'ers. Besides, I wa

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Graham Cox
On 11/11/2011, at 6:14 PM, Don Quixote de la Mancha wrote: > What I am really, really concerned about though is that the iOS is > inherently unreliable. You're right. I wouldn't want my iPhone flying my Airbus. But you're talking about the Game Of Life, a whole different kettle of bananas. Mig

Re: 2 itunesconnect questions

2011-11-11 Thread Conrad Shultz
See comments below. (Sent from my iPhone.) -- Conrad Shultz On Nov 11, 2011, at 13:39, Development wrote: > That's the problem I ran in to. I wanted to maintain some degree of backward > compatibility 4.2 OK. But architecture and target SDK can be throttled independently. So set your

Re: 2 itunesconnect questions

2011-11-11 Thread Development
Well your average dolt that jailbreaks and knows absolutely nothing about it would be blockaded. It's the folks that have hex editors and the time to figure it out that will find it easy. Which is still a little too much for many JB'ers. Besides, I want to see it broken so I can figure out how to

Re: 2 itunesconnect questions

2011-11-11 Thread Development
That's the problem I ran in to. I wanted to maintain some degree of backward compatibility 4.2 However... honestly... I dont have anything pre ipod 3 iphone 3gs to even test on so I can't say with any accuracy the software will work anyway. I guess switching to 4.3 minimum is fine. I mean

Re: 2 itunesconnect questions

2011-11-11 Thread Conrad Shultz
On 11/11/11 1:21 PM, Glenn L. Austin wrote: > Set your iOS Deployment Target to iOS 4.3 and build ARMv7. I don't think the OP said that the app should be version restricted. Why target 4.3? -- Conrad Shultz Synthetiq Solutions www.synthetiqsolutions.com ___

Re: 2 itunesconnect questions

2011-11-11 Thread Conrad Shultz
On 11/11/11 1:11 PM, Development wrote: > Well like I said in my previous email. I need to know how to build my > app to run as an iPhone app on iPhone and a iPad app on iPad. Since I > always use device specifics in the interface. > > In the setting in the Build Summary I've set it to Universal.

Re: 2 itunesconnect questions

2011-11-11 Thread Glenn L. Austin
On Nov 11, 2011, at 1:11 PM, Development wrote: > Well like I said in my previous email. I need to know how to build my app to > run as an iPhone app on iPhone and a iPad app on iPad. Since I always use > device specifics in the interface. > > In the setting in the Build Summary I've set it to

Re: How does LaunchServices decide which version of an app to open?

2011-11-11 Thread Fritz Anderson
On 11 Nov 2011, at 3:12 PM, Eric Wing wrote: > I am trying to understand how Mac (I'm running Lion) decides which > version to launch. I am puzzled because it doesn't go to the oldest, > it doesn't go to the newest, and it doesn't go to the last recently > used. (If it is already open, it always g

Re: 2 itunesconnect questions

2011-11-11 Thread Heijink, Hank
Universal doesn't mean armv6 and armv7 in this case: it means you have a dedicated iPad interface too. If you don't, don't set it to universal. There are no armv6 iPads, although I don't see why you wouldn't be able to submit an app that contains both architectures. Have you tested your build o

How does LaunchServices decide which version of an app to open?

2011-11-11 Thread Eric Wing
I have a URL scheme handler for my app so I can invoke from other apps, etc. With my particular project, we put out daily beta builds so our advanced users frequently have multiple versions of our app on their disk. I am trying to understand how Mac (I'm running Lion) decides which version to laun

Re: 2 itunesconnect questions

2011-11-11 Thread Development
Well like I said in my previous email. I need to know how to build my app to run as an iPhone app on iPhone and a iPad app on iPad. Since I always use device specifics in the interface. In the setting in the Build Summary I've set it to Universal. in the Build Settings the arch is set to the on

Re: 2 itunesconnect questions

2011-11-11 Thread Conrad Shultz
Quick note: the 3GS and onward use ARMv7. You would not be limited to the 4S. (Sent from my iPhone.) -- Conrad Shultz On Nov 11, 2011, at 12:42, Development wrote: > I attempted to submit an app last night and it failed validation because it's > universal but did not include armv6 arch. I'm

Re: 2 itunesconnect questions

2011-11-11 Thread Development
ok... since I'm apparently stupid... Why, if I set my build setting in the summary to universal am I rejected? do I need to change this to iPhone? And when I do of course I loose iPad specifics as well as the full screen interface I guess I don't understand what I'm supposed to do now. On

Re: 2 itunesconnect questions

2011-11-11 Thread Heijink, Hank
On Nov 11, 2011, at 3:42 PM, Development wrote: > Problem. an upcoming game i'm working on requires a certain library I > purchased and of course do not have code level access too. It was not > compiled correctly for me to use the universal setting in xcode. it's armv7 > only. Hence I cannot su

Re: 2 itunesconnect questions

2011-11-11 Thread Development
I forgot to ask question two The second is that I want to prevent my iOS apps from running on jailbroken devices. Doing this is easy, albeit easily circumvented too, however is it "Legal" to do this? On Nov 11, 2011, at 1:42 PM, Development wrote: > I attempted to submit an app last nig

Re: 2 itunesconnect questions

2011-11-11 Thread Development
I forgot to ask question two The second is that I want to prevent my iOS apps from running on jailbroken devices. Doing this is easy, albeit easily circumvented too, however is it "Legal" to do this? On Nov 11, 2011, at 1:42 PM, Development wrote: > I attempted to submit an app last night

2 itunesconnect questions

2011-11-11 Thread Development
I attempted to submit an app last night and it failed validation because it's universal but did not include armv6 arch. I'm using xcode 4.2 and assumed the universal (and only) selectable setting was fine. It was not. Easy correction of the issue, manually set the archs. Problem. an upcoming g

Re: -tableView:accessoryButtonTappedForRowWithIndexPath: Sometimes returns wrong indexPath.row

2011-11-11 Thread Luke Hiesterman
On Nov 11, 2011, at 12:35 PM, Michal L. Wright wrote: > Hi, > > I have a UITableView that has four sections. Sections 0 and 2 have a single > row each. Sections 1 and 3 have variable numbers of rows. > > Each row in sections 1 and 3 has an accessory view set up by the following > lines in -ta

-tableView:accessoryButtonTappedForRowWithIndexPath: Sometimes returns wrong indexPath.row

2011-11-11 Thread Michal L. Wright
Hi, I have a UITableView that has four sections. Sections 0 and 2 have a single row each. Sections 1 and 3 have variable numbers of rows. Each row in sections 1 and 3 has an accessory view set up by the following lines in -tableView:cellForRowAtIndexPath: UITableViewCell cell;

Re: Logging in Xcode 4.2

2011-11-11 Thread Nathan Sims
On Nov 10, 2011, at 9:13 AM, Kyle Sluder wrote: > On Thu, Nov 10, 2011 at 8:44 AM, Richard Somers > wrote: >> I think they will eventually get it right. No way am I going back to Xcode 3. > > Xcode brought with it some massive improvements (workspaces with > multiple projects!) at some serious u

Re: UITextField and UIGestureRecognizers

2011-11-11 Thread Matt Neuburg
On Fri, 11 Nov 2011 11:17:17 +0100, Olivier Palliere said: > >Yeah I know it sounds like this is against the framework, but I eventually got >it reading the doc and poking around the web. Basically the UITextField's >gesture recognizers are reseted to a default value every time it's being >edi

Re: Why does changing a UIScrollView's contentInset change contentOffset?

2011-11-11 Thread Matt Neuburg
On Thu, 10 Nov 2011 07:48:56 -0800, Matt Neuburg said: >On Tue, 08 Nov 2011 12:05:55 -0500, David Hoerl said: >>when I set "contentInset" that contentOffset was getting set to >>0,0. >> >>Is this known behavior (or desired behavior?) > >Don't beat yourself up over this. You figured it out (well

Re: NSDateFormatter not working on iOS 5.

2011-11-11 Thread Matt Neuburg
On Fri, 11 Nov 2011 16:13:49 +0800, Kin Mak said: >The following code used to work fine prior to iOS 5. The dateFromString method >seems to stop working on iOS 5 and always returns null. I suspect this is a >bug introduced in iOS 5.0. Have anyone encountered the same issue? Or do I >miss somet

Re: Lion autosave loses NSTextView position/selection

2011-11-11 Thread Fritz Anderson
On 11 Nov 2011, at 11:00 AM, Fritz Anderson wrote: > My application writes an XML document that includes styled text in the form > of HTML. At the user end is an NSTextView; I use an in-memory Core Data store > for working storage. The text view is bound to the backing NSManagedObject > through

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Bill Bumgarner
On Nov 10, 2011, at 6:03 PM, Don Quixote de la Mancha wrote: > I don't have a problem with the system killing runaway processes. > What I have a problem with is that calloc() NEVER returns NULL. If it > ever did, I would have plenty of opportunity to deallocate ALL of the > memory I just allocat

Re: Different deployment target for iPhone & iPad

2011-11-11 Thread Matt Neuburg
On Thu, 10 Nov 2011 07:43:01 -0800, Matt Neuburg said: >On Tue, 08 Nov 2011 21:59:59 +0530, Sasikumar JP said: >>Is it possible to set the iPad minimum deployment target as iOS 5 and iPhone >>deployment target as ios 4.2 > >I don't think so. Most apps that I'm familiar with, if they have issues

Lion autosave loses NSTextView position/selection

2011-11-11 Thread Fritz Anderson
10.7 SDK, targeting 10.6 and 10.7. My application writes an XML document that includes styled text in the form of HTML. At the user end is an NSTextView; I use an in-memory Core Data store for working storage. The text view is bound to the backing NSManagedObject through an NSArrayController. I

Re: nscollectionview dims and brightens frequently with call to setContent:

2011-11-11 Thread Michael Hanna
Yeah, you're right that will work.. thanks. Michael On Fri, Nov 11, 2011 at 10:46 AM, Kyle Sluder wrote: > On Nov 11, 2011, at 6:43 AM, Michael Hanna wrote: > > > Hi Kyle et. al. > > > > On network refreshes, rebuild an entire temp array from an xml blob all > over again to include changes to

Re: nscollectionview dims and brightens frequently with call to setContent:

2011-11-11 Thread Kyle Sluder
On Nov 11, 2011, at 6:43 AM, Michael Hanna wrote: > Hi Kyle et. al. > > On network refreshes, rebuild an entire temp array from an xml blob all over > again to include changes to individual items in the array. They are an array > of NSMutableDictionary. This is not ideal, I know but not sure o

Re: nscollectionview dims and brightens frequently with call to setContent:

2011-11-11 Thread Michael Hanna
Hi Kyle et. al. On network refreshes, rebuild an entire temp array from an xml blob all over again to include changes to individual items in the array. They are an array of NSMutableDictionary. This is not ideal, I know but not sure of a cleaner solution. yes, I created an NSArrayController that

Re: NSDateFormatter not working on iOS 5.

2011-11-11 Thread Νικόλας Τουμπέλης
Hi Kin, It looks like you discovered something. I've tried it on the iPhone Simulator and it doesn't work right, like you said. However, it _does_ work on the device. Thanks, On 11 Νοε 2011, at 3:17 μ.μ., Kin Mak wrote: > Hi Nick, > > The code works fine in iOS 4.3 or earlier, but not anymor

Re: NSDateFormatter not working on iOS 5.

2011-11-11 Thread Kin Mak
Hi Nick, The code works fine in iOS 4.3 or earlier, but not anymore on iOS 5.0. I didn't try it on Mac OSX tough But if you try the code on different versions of iOS, the result may not be the same. Don Quixote, Thanks for your tips of using assert. I am now wondering if there is anything to d

Re: NSDateFormatter not working on iOS 5.

2011-11-11 Thread Don Quixote de la Mancha
> On 11 Νοε 2011, at 10:13 π.μ., Kin Mak wrote: >> The following code used to work fine prior to iOS 5. The dateFromString >> method seems to stop working on iOS 5 and always returns null. 2011/11/11 Νικόλας Τουμπέλης : > I've tried the snippet in both Mac OS X and iOS and found that it still >

Re: UITextField and UIGestureRecognizers

2011-11-11 Thread Olivier Palliere
HI Guys, Yeah I know it sounds like this is against the framework, but I eventually got it reading the doc and poking around the web. Basically the UITextField's gesture recognizers are reseted to a default value every time it's being edited. So you need to setup your own custom recognizer eve

Re: NSDateFormatter not working on iOS 5.

2011-11-11 Thread Νικόλας Τουμπέλης
Hi Kin, I've tried the snippet in both Mac OS X and iOS and found that it still works. What are you doing prior to calling dateFromString: ? Thanks, Nick On 11 Νοε 2011, at 10:13 π.μ., Kin Mak wrote: > The following code used to work fine prior to iOS 5. The dateFromString > method seems to

Re: Allocating too much memory kills my App rather than returning NULL

2011-11-11 Thread Quincey Morris
On Nov 10, 2011, at 23:14 , Don Quixote de la Mancha wrote: > I implemented both the app delegate and view controller memory > warnings, then set breakpoints at both of them. The breakpoints don't > get hit. You missed the point of the comments made much earlier in the thread. The breakpoints w

NSDateFormatter not working on iOS 5.

2011-11-11 Thread Kin Mak
The following code used to work fine prior to iOS 5. The dateFromString method seems to stop working on iOS 5 and always returns null. I suspect this is a bug introduced in iOS 5.0. Have anyone encountered the same issue? Or do I miss something here? Any tips or hints will be highly appreciate