Re: can we have own application logo for ad-hoc release.

2010-06-22 Thread Bryan Henry
A legitimate distribution channel with a max of 100 users per year? That's a pretty limited market. Ad hoc exists or beta testing, app reviewer copies (along with promo codes), and other such things. Apple had taken steps in the past to limit the utility of Ad Hoc as a distribution mechanism

Re: Memory management on returning nil in init

2010-06-21 Thread Bryan Henry
Yes, you would want to call [self release]; before returning nil in your initializer. That's the common pattern. Otherwise you do leak the allocated (but improperly initialized) object. - Bryan Sent from my iPhone On Jun 21, 2010, at 10:43 AM, Eiko Bleicher bleic...@k4it.de wrote: One of my

Re: NSNumber stringValue

2009-12-11 Thread Bryan Henry
You should not compare floating point numbers for equality in most cases. This is true of any language on any platform. See http://www.cygnus-software.com/papers/comparingfloats/Comparing%20floating%20point%20numbers.htm - Bryan On Dec 10, 2009, at 10:02:23 PM, RedleX Support wrote: Hi,

Re: Does NSData rearrange the order of bits?

2009-12-02 Thread Bryan Henry
Your log messages show that the NSData's bytes are stored completely correctly, you're just interpreting it incorrectly. NSData's description method will list the bytes in order, so you see 510600f0. On the other hand, you used the %x format specifier to create your string, which will print

Re: Unable to disassemble objc_assign_strongCast

2009-11-02 Thread Bryan Henry
snip Here's the normal way to do it: NSError *saveError; [importContext save:saveError]; Important nitpick: NSError *saveError = nil; [importContext save:saveError]; Methods that follow the NSError** convention are not required to actually assign a value to the saveError pointer, so

Re: objectAtIndex

2009-11-01 Thread Bryan Henry
That line alone does not indicate any memory leaks occurring due to over-retaining objects. You'll need to provide more context (the surrounding code, etc). The object returned by -[NSArray objectAtIndex:] is the actual object (ie. pointer to the actual object's space in memory) stored in

Re: [iPhone] Why so many calls?

2009-10-27 Thread Bryan Henry
Have you tried a table with 99 sections to see whether that scaling is really the case? While I agree that some of those are likely unnecessary calls that could be optimized away, this is all more the subject of an enhancement report for Radar than anything else. - Bryan On Oct 27,

Re: Professional Error Handling

2009-10-22 Thread Bryan Henry
Regarding your second case specifically, I usually define an error domain and error codes using an extern NSString* const plus an enum on a per-class basis. // This for the header extern NSString *const ExpressionProcessorErrorDomain; enum { EPUnmatchedParenthesesError = 21,

Re: Does Core Data have reserved Entity names?

2009-09-30 Thread Bryan Henry
As a general rule, you want to avoid attempting to name classes with such generic names. It makes you very much more likely to end up with a class name conflict somewhere, especially in large projects. Classname prefixes are usually what's used to help ensure there are no such conflicts.

Predicate matching for entire to-many relationship

2009-09-24 Thread Bryan Henry
Hey list - I'm trying to determine what the best approach for writing a Core Data fetch predicate to match objects with a specific set for a to-many relationship is, so I'd appreciate some guidance. A portion of my Core Data model looks like so -- http://is.gd/3Dyp4 I am attempting to

Re: singleton pattern in cocoa

2009-09-14 Thread Bryan Henry
This question usually gets asked at least a couple times a month. I suggest you look up the previous responses on CocoaBuilder (http://www.cocoabuilder.com/ ), which archives responses on this mailing list if you want an exhaustive response, since all solutions have been mentioned somewhere

Re: (no subject)

2009-09-07 Thread Bryan Henry
According to the memory management rules, yes, you own the object returned by that method and you should therefore release it. You take ownership of an object if you create it using a method whose name begins with “alloc” or “new” or contains “copy” (for example, alloc,newObject, or

Re: Force crash a cocoa app for Crash Reporter testing

2009-08-20 Thread Bryan Henry
[[NSArray array] objectAtIndex:0]; if you want an exception. - Bryan Sent from my iPhone On Aug 20, 2009, at 1:04 PM, aaron smith beingthexemplaryli...@gmail.com wrote: Hey All, I'm trying to do some testing with Smart Crash Reporter, which integrates with Crash Reporter. So I'm trying to

Re: When do I need to override hash?

2009-08-20 Thread Bryan Henry
Why do you say that? I haven't noticed any documented requirement that ties the implementation details of -hash and -isEqual together. - Bryan Sent from my iPhone On Aug 20, 2009, at 4:27 PM, Clark Cox clarkc...@gmail.com wrote: On Thu, Aug 20, 2009 at 12:33 PM, David

Re: When do I need to override hash?

2009-08-20 Thread Bryan Henry
Yes, but the problem with a hash based on the pointer is that it limits your isEqual implemenation from being based on anything more than the pointer, or you violate the If objects are equal, they must have the same hash rule. (Earlier email was a brain fart on my part.) - Bryan Sent

Re: [iphone] displaying multiple images

2009-08-18 Thread Bryan Henry
Sounds like a rather simple combination of UIScrollView with it's pagingEnabled property set to YES and some UIImageViews. - Bryan Sent from my iPhone On Aug 18, 2009, at 7:22 PM, Dragos Ionel dragosio...@gmail.com wrote: Is there any control that would allow to load multiple images at

Re: Coding with VM limitation on the iPhone?

2009-08-18 Thread Bryan Henry
The proper way to manage large objects that can be easily reloaded as needed is to make sure and respond to memory warnings. The exact amount of memory available to your application depends on both the device (which could vary greatly in terms of hardware resources) and other processes

Re: Coding with VM limitation on the iPhone?

2009-08-18 Thread Bryan Henry
controller. - Bryan Sent from my iPhone On Aug 18, 2009, at 7:37 PM, Bryan Henry bryanhe...@mac.com wrote: The proper way to manage large objects that can be easily reloaded as needed is to make sure and respond to memory warnings. The exact amount of memory available to your application depends

Re: CoreData many-to-many Relationship Question

2009-07-26 Thread Bryan Henry
Yes, as long as you object graphic consistency for you. You should look at the Core Data Programming Guide, which this excerpt is from: Since Core Data takes care of the object graph consistency maintenance for you, you only need to change one end of a relationship and all other aspects

Re: IMEI Codes?

2009-07-13 Thread Bryan Henry
You can get the unique device identifier (UDID) for a device, which is a hash of different hardware identifiers (like the serial number) - look at UIDevice. Its not really clear for what purposes you need the identifier for, though, so whether or not you really need that or something else

Re: State of the Union videos?

2009-06-12 Thread Bryan Henry
Last year's session videos were posted to ADC on iTunes in February of this year, so I wouldn't hold your breath for seeing them anytime soon. ADC on iTunes: http://developer.apple.com/adconitunes - Bryan On Jun 12, 2009, at 10:32 AM, Todd Heberlein wrote: Does anyone know if/when Apple

Re: Using non-id sender in IBAction methods

2009-06-07 Thread Bryan Henry
I hope you aren't suggesting that he use assertions in production code - that's much worse practice than specifying a non-id parameter for an action method. As someone already said, if your action method is specific enough to the type of sender object where specifying it's type keeps you

Re: NSString and decoding HTML Entities

2009-04-05 Thread Bryan Henry
The HTML entities that Stuart is talking about aren't percent escapes, and aren't replaced by - stringByReplacingPercentEscapesUsingEncoding:. - Bryan On Apr 5, 2009, at 4:19 PM, Jack Carbaugh wrote: Why don't you just use the features of NSString ?

Re: Looking for [NSNumber numberWithString:]

2009-04-01 Thread Bryan Henry
There is no -numberWithString:, no. You'd need to do something like [NSNumber numberWithDouble:[someStr doubleValue]]. - Bryan On Apr 1, 2009, at 9:17 PM, Greg Robertson wrote: I would like to convert an NSString to an NSNumber. Is there a direct method for this or should I go NSString to

Re: NSMutableArray is null?

2009-03-31 Thread Bryan Henry
You declared a pointer to an instance of NSMutableArray as an instance variable of Example_Class (its in no way global) there, but you didn't create an instance of NSMutableArray. Did you do something like this at some point? globalVariable = [[NSMutableArray alloc] init]; - Bryan On Mar

Re: Do I need to relase @string ??

2009-03-02 Thread Bryan Henry
Assuming that the setter is copying the value passed in (which it should be, considering setCurrentMiles: should accept a single NSString*), yes James, you should release currentMiles in your - (void)dealloc implementation for that class. The release won't affect the constant strings, but

Re: alloc/release confusion

2009-02-13 Thread Bryan Henry
When you call -show, the UIAlertView is retained elsewhere (somewhere in SpringBoard's internals). It does look a bit odd, and understandably so, but the -release is correct there because you still want to relinquish your ownership of the object...the ownership you took when you sent the

Re: iphone and images issues

2009-02-07 Thread Bryan Henry
Keep in mind that if you do this, though, Xcode's PNG optimization operations (switching RGBA - GBRA and premultiplying the alpha) won't occur if you have any PNGs in that folder - it'll just copy the folder whole. How is having a messy bundle any problem? Its not like it actually

Re: Simple memory problem

2009-02-06 Thread Bryan Henry
It sounds to me like you want to use garbage collection, not manual memory management. Does C automatically free() memory when pointers get replaced? No, obviously not. Doing so would be silly, and its even more silly to want such behavior with Objective-C. This: inputString = [NSString

Re: Memory management question in Objective-C 2.0 @property notation

2009-02-05 Thread Bryan Henry
No, you do need to release it. You should release the ivars for any retain or copy-type properties in your -dealloc implementation. Is your property was just an assign property, then you would not need to release it in -dealloc. Also - a common mistake when using properties is to set the

Re: Returning a value from a function

2008-04-08 Thread Bryan Henry
Change your function definition to - (NSString*)convertFunctionWithValues:(NSString*)etc and just add return retVal; Also, its not really necessary but in the interest of good coding practices you may want to consider passing an array (NSArray of NSNumber or whatever) to

Re: Returning a value from a function

2008-04-08 Thread Bryan Henry
Also, according to your code at the bottom here, you want to return a value from a METHOD not a function. Mike. That's splitting hairs just a little. Most people use the terms interchangeably, at least informally, and trying to introduce the distinction just for the sake of it has the