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
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
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,
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
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
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
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,
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,
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.
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
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
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
[[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
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
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
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
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
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
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
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
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
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
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 ?
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
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
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
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
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
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
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
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
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
32 matches
Mail list logo