Re: NSData from dispatch_data_t?

2018-10-30 Thread Greg Parker
he dispatch_data_t object header. That is not going to match the dispatch_data_t's actual contents. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: NSData from dispatch_data_t?

2018-10-30 Thread Greg Parker
d to copy the data. (Of course, if the code using it as an NSData goes on to call -bytes instead of -enumerateByteRangesUsingBlock: then it would be forced to copy into a contiguous representation anyway.) -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler _

Re: Dealing with an @available warning

2018-10-23 Thread Greg Parker
" pInfo.orientation = (NSPaperOrientation)NSPortraitOrientation; #pragma clang diagnostic pop You should file a bug report against AppKit. I'm not sure there is any benefit to marking a plain C enum as unavailable. Use of a new enum would work fine when running on an old

Re: C++ pointer to Cocoa object

2018-09-07 Thread Greg Parker
contains this mCocoaPopupPtr field were itself deallocated then a use-after-free could cause this symptom. >> Is there some other way to test for an invalid void pointer? There is no way to programmatically distinguish all valid Objective-C object pointers from all invalid ones. It&#x

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Greg Parker
, so it may allocate a new autoreleased string object every time it runs that line. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator com

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Greg Parker
> On Dec 4, 2017, at 2:56 PM, Rick Mann wrote: > >> On Dec 4, 2017, at 14:55 , Greg Parker wrote: >> >>> On Dec 4, 2017, at 2:51 PM, Ben Kennedy wrote: >>> >>>> On Dec 4, 2017, at 2:47 PM, Rick Mann wrote: >>>> >>>

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Greg Parker
You can also skip the middleman and use `@kSomeCStringConstant`. After the preprocessor runs it will be `@"foo"` which the ObjC compiler is perfectly happy with. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing

Re: Is "-init" really needed?

2017-08-07 Thread Greg Parker
dent of its correctness, the code above *looks* wrong. That alone is bad. It ought either to call -init or to have a big scary comment describing why it is safe not to. * If Foo is ever changed to have a superclass other than NSObject, the code above is likely to be wrong. -- Greg Parker

Re: Who owns a child view controller?

2017-07-14 Thread Greg Parker
e-language-specific. (The only exception would be if the Swift compiler > knew that a function was private and final, so it controlled both ends of the > call.) The Swift compiler can avoid autorelease more often than that. Swift can use a simple callee-retain caller-release conve

Re: Who owns a child view controller?

2017-07-14 Thread Greg Parker
you if an object is pointed to by some autorelease pool. You can call _objc_autoreleasePoolPrint() in the debugger to dump the contents of the current thread's autorelease pool stack. You can set environment variable OBJC_PRINT_POOL_HIGHWATER=YES to record stack traces when a large autoreleas

Re: Who owns a child view controller?

2017-07-12 Thread Greg Parker
arising from this reference becoming > invalid. The most common problem I know of is from table and outline view > delegate and data source references. In many cases, it’s wise to nil these > out manually when (say) your window closes. We prefer to use "unretained" or &q

Re: Who owns a child view controller?

2017-07-12 Thread Greg Parker
unting” that might be equivalent. Deferred reference counting is not much like autorelease. The goal of deferred RC is to accumulate many retain and release operations from a single thread and apply them all at once, in the hopes of reducing the cost of repeated refcount operations on a singl

Re: Context leak detected, msgtracer returned -1 ?

2017-05-22 Thread Greg Parker
ug report that this log is too vague. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: Binary floating point format

2017-03-30 Thread Greg Parker
> On Mar 30, 2017, at 9:03 PM, Carl Hoefs > wrote: > >> On Mar 30, 2017, at 8:10 PM, Greg Parker > <mailto:gpar...@apple.com>> wrote: >> >>> On Mar 30, 2017, at 7:09 PM, Carl Hoefs >> <mailto:newsli...@autonomy.caltech.edu>> wrote: &g

Re: Binary floating point format

2017-03-30 Thread Greg Parker
f 2 here that it's hard to trust any guess. Using CFSwapInt64() from CoreFoundation/CFByteOrder.h and from_vax_d8() from https://pubs.usgs.gov/of/2005/1424/ <https://pubs.usgs.gov/of/2005/1424/>, your bytes above are: -41.7215935353 -49.7215935353 -49.7215935353 -49.7215935366 -4

Re: Binary floating point format

2017-03-30 Thread Greg Parker
apping is a good hint that you're looking at a PDP-11 / VAX format. There are two different 64-bit VAX formats, though, and neither is identical to IEEE even after correcting for the byte order. Simply shuffling VAX bytes and interpreting as an IEEE double would be misleadingly clos

Re: Binary floating point format

2017-03-30 Thread Greg Parker
s your floating-point format unless you have a collection of known values in both IEEE format and your format. Many of the historical formats are similar enough that misinterpretation could give incorrect values that look reasonable by eye. -- Greg Parker gpar...@apple.com <mailto:gpa

Re: Can't use +initialize, now what?

2017-03-29 Thread Greg Parker
tack frames into your backtrace which can help identify when +initialize deadlock occurs: `_WAITING_FOR_ANOTHER_THREAD_TO_FINISH_CALLING_+initialize` and `_CALLING_SOME_+initialize_METHOD`. Environment variable OBJC_PRINT_INITIALIZE_METHODS=YES logs some details of +initialize processing that

Re: Can't use +initialize, now what?

2017-03-29 Thread Greg Parker
itialize checking is free once you pay the cost of objc_msgSend(). (The ObjC runtime checks +initialize on uncached dispatch, and never caches anything until +initialize completes. Most dispatches are cached so they pay nothing for +initialize support.) +initialize in Swi

Re: NSMutableData +dataWithLength: sets errno?

2017-03-14 Thread Greg Parker
> call you make might randomly overwrite errno with gibberish. The POSIX standard specifically states that errno's value is undefined almost everywhere and can be arbitrarily changed by almost anything. http://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html <http://pubs.o

Re: -forceCancel an NSOperation

2017-03-01 Thread Greg Parker
be reliably enforced even if the student code is stuck in a hang or a loop. I can't argue with the classification of student code as "hostile" and "malicious". -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler _

Re: macOS 10.13 suggestion for init() throws

2017-02-28 Thread Greg Parker
e NSDocument would break all of its existing subclasses. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moder

Re: What generates NSURLErrorUnsupportedURL?

2017-02-08 Thread Greg Parker
RL is also recorded in the NSError's userInfo dictionary as NSURLErrorFailingURLStringErrorKey. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mod

Re: Overriding the release mehod

2017-01-25 Thread Greg Parker
an override ought to call [super release] if the object is expected to be retained and released and deallocated normally. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler > On Jan 25, 2017, at 8:23 AM, Dave wrote: > > I hate it when

Re: Using floating point instructions

2016-12-06 Thread Greg Parker
t operand 0 must use '&' constraint > > Is there a way to fix this problem? You'll get better answers from a clang list such as cfe-us...@lists.llvm.org. Most of the audience here probably does not have a copy of clang that can compile PowerPC code. Why are you using

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-20 Thread Greg Parker
. Log or crash in dealloc, if your singleton enforcement might allow the object to be deallocated and then a new one to be created. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Greg Parker
ation." No difference. C static storage with no initializer is always initialized to zero. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Pl

Re: How to count Atoms

2016-10-10 Thread Greg Parker
g. The deprecation warning told you to use memory_order_relaxed because that is the memory ordering used by OSAtomicIncrement64. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (Coco

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Greg Parker
un on 10.11.6 and yet I see these > message-to-zombie crashes after removing the setDelegate:nil code. Those crashes are expected. NSTableView's delegate is zeroing-weak when both of the following are true: * Your app was built with the 10.11 SDK or newer. * Your app is running

Re: Why doesn't this crash?

2016-09-12 Thread Greg Parker
yMessage]. You must use the result of objc_getClass() instead. Some "unavailable" classes were in fact present as SPI on older OS versions. That will confuse tests like `if ([SomeClass class]) { … }`. Test your code on your old deployment targets. -- Greg Parker gpar...@apple.com

Re: How to do isKindOfClass in Swift

2016-09-12 Thread Greg Parker
is generating incorrect code or incorrect debug > information or corrupting its own indexes. I’ve seen it in my own projects, > and problems have been reported in the developer forums that sound similar. > Typically, it appears, cleaning the build folder fixes the problem. Did

Re: Linking against AVKit breaks app on 10.6

2016-09-12 Thread Greg Parker
ted, while the other frameworks do. You can force weak linking > for that particular framework using > > -weak_framework AVKit > > instead of just using the normal “-framework”. Please file a bug report. A missing availability at

Re: Init in Swift

2016-09-06 Thread Greg Parker
protocol extensions can solve some of those problems. The protocol extension provides a default implementation to every class that conforms to the protocol. Each class may provide its own implementation that overrides the protocol extension's default implementation. --

Re: Mysterious crash with NSTableView

2016-08-27 Thread Greg Parker
environment variables then you may be able to use the scan-build tool to run the clang static analyzer. http://clang-analyzer.llvm.org/scan-build.html -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (C

Re: Codesign assumes folder structure, fails.

2016-07-26 Thread Greg Parker
ion? My understanding is that this is a limitation of the Xcode build system. codesign doesn't care about the framework's structure, but Xcode does and it is telling codesign to look at the wrong path. You should mention rdar://17814234 when you file your bug report. -- Greg Parke

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Greg Parker
too easy to accidentally bind to an unrelated superclass ivar when you really wanted to create a new ivar. -- Greg Parker gpar...@apple.com <mailto:gpar...@apple.com> Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.app

Re: debugging AirDrop (update)

2016-06-01 Thread Greg Parker
. > > Can anybody explain why 3 reboots ≠ 1 reboot? One possibility: some systems will reset caches or other state if the previous uptime was too short. This gets you out of reboot loops when a cache gets corrupted, for example. -- Greg Parker gpar...@apple.com <mailto:gpa

Re: BOOL parameter passed as nil object

2016-04-19 Thread Greg Parker
ven there. On some platforms BOOL is defined as signed char. It may have any of 254 values other than YES or NO. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: BOOL parameter passed as nil object

2016-04-19 Thread Greg Parker
ent a_bool end up with a 1 value assigned to it? Don't do that. The behavior is undefined. It will certainly fail on some current architectures at least some of the time. You should not use -performSelector:withObject: to call methods that use non-object parameters. -- Greg Par

Re: Returning a string value from a c function to a Objective-C class method. Is there an approved approach?

2016-03-04 Thread Greg Parker
ect that performs the callback and pass it to the C code to store and call. The block object would capture the target NSObject so you don't need the dictionary of callback targets. -- Greg Parker gpar...@apple.com Runtime Wrangler _

Re: ARC code in a non ARC app. iOS

2016-02-24 Thread Greg Parker
> On Feb 24, 2016, at 2:31 AM, Dave wrote: > > Also, beware subclassing a Non-ARC Class in an ARC Project - you have to have > the subclass Non-ARC too. This is not true. For example, NSView is not ARC but you can write ARC subclasses of it. -- Greg Parker gpar.

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Greg Parker
Objective-C++ compilers. Plain C code is unaffected. Note that you may need code changes if your C code uses CoreFoundation types and you want to call it from ARC code. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Greg Parker
eature(objc_arc) # error This file must be compiled with ARC enabled. #endif -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Greg Parker
hin an app that doesn't? Yes, -fno-objc-arc works on iOS too. Was that your question? -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mod

Re: calendar & repeating events api

2016-02-16 Thread Greg Parker
k: to find "fifth Saturdays" after some starting date. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the l

Re: Obj-C - your thoughts on hiding data members?

2016-01-25 Thread Greg Parker
rimary @interface are @protected by default. Therefore you should either move your ivars out of the primary @interface, or leave them in @interface but explicitly declare them @private or @package. -- Greg Parker gpar...@apple.com Runtime Wrangler ___

Re: Adding minutes to display time

2015-12-08 Thread Greg Parker
way off. How to fix this?* What is the value of print(startDate) ? What do you get if you display `date` and `startDate` using an NSDateFormatter instead of print() ? I bet `date` and `startDate` are in fact five minutes apart, but either your date co

Re: Swift screensavers in Ubuntu?

2015-12-04 Thread Greg Parker
the Swift-ObjC importer. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)

Re: The joys of people using valueForKey to get objects out of a dictionary.

2015-11-10 Thread Greg Parker
11-10 10:00:55.296 a.out[38293:4747164] ordinary value 2015-11-10 10:00:55.297 a.out[38293:4747164] ( something, ordinary, "@allKeys", "@something" ) 2015-11-10 10:00:55.298 a.out[38293:4747164] *** Terminating app due to uncaught exception 'NSUnknownKeyEx

Re: NSFileWrapper - is this really so bad?

2015-10-27 Thread Greg Parker
27;t match. It is unlikely that all of the new annotations and all of the documentation are correct. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: New warning in Xcode 7

2015-10-13 Thread Greg Parker
orm was allowed, but I'm not enough of a language lawyer to know for sure. You might get better answers from a compiler mailing list. You can avoid confusion (human and compiler) by writing the statement without the preincrement's side effect: ix

Re: More Swift issues, NSURLComponents

2015-10-06 Thread Greg Parker
> On Oct 5, 2015, at 7:57 PM, Rick Mann wrote: > > Especially when a struct can be an AnyObject. `AnyObject` is an instance of any class type. It is never a struct. `Any` encompasses both classes and structs. -- Greg Parker gpar...@apple.com Runtime

Re: Mac OSX 10.11 and XCode

2015-10-01 Thread Greg Parker
gs? If I recall correctly, you can choose whether or not to relaunch apps when you deliberately log out or restart, but relaunch is automatic for involuntary crashes. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev maili

Re: -[NSThread start] blocks ?!?

2015-09-28 Thread Greg Parker
d by the debugging tools. (Specifically, it's the machinery that records stack traces of queue operations.) If you see this again, please capture a spindump and file a bug report. After you file the bug report, you might be able to work around it like this: defaults write com.apple.dt.

Re: OpenGL Vertical Syncing effect on run loops

2015-09-22 Thread Greg Parker
g factor, not anything in the runloop or NSTimer itself. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

Re: Error unwrapping an optional which isn't an optional

2015-09-21 Thread Greg Parker
ause it's not optional so Swift won't let it in an 'if > let'. selectedRow's "row index or -1" behavior is an obvious candidate for a Swift optional, but we don't currently have a good way to bridge such API with Objective-C. -- Greg Parker gpar..

Re: Tracking down source of [_NSControllerObjectProxy copyWithZone:]… error

2015-09-21 Thread Greg Parker
at the bottom > Add Exception Breakpoint) Another dumb alternative: implement -[_NSControllerObjectProxy copyWithZone:] to call abort() or otherwise halt the process. Then it will stop in the debugger or generate a crash log with a stack trace pointing to the call site. -- Greg Parker gp

Re: Swift: combining Obj-C enums

2015-09-09 Thread Greg Parker
gPropertiesForKeys: nil, > options: > .SkipsSubdirectoryDescendants | .SkipsPackageDescendants | .SkipsHiddenFiles) In Swift 2 this is an OptionSetType. An option set literal looks like this: [.SkipsSubdirectoryDescendants, .SkipsPackageDescendants, .SkipsHiddenFiles] -- Greg

Re: String.join()?

2015-09-04 Thread Greg Parker
you it doesn’t exist any more), so you can’t call it or > command-click to it. You should file a bug report. It might be possible to make unavailable identifiers command-clickable, which would reveal their OS availability range or their suggeste

Re: Swift: should computed properties be able to throw exceptions?

2015-08-21 Thread Greg Parker
> On Aug 21, 2015, at 9:00 PM, Rick Mann wrote: > >> On Aug 21, 2015, at 20:58 , Greg Parker wrote: >> >>> Rick Mann wrote: >>> >>> Also, if the method of the call site is marked as "throws," does that mean >>> the error wil

Re: Swift: should computed properties be able to throw exceptions?

2015-08-21 Thread Greg Parker
> On Aug 21, 2015, at 8:18 PM, Rick Mann wrote: > >> On Aug 21, 2015, at 20:06 , Greg Parker wrote: >> >>> On Aug 21, 2015, at 6:15 PM, Rick Mann wrote: >>> >>>> On Aug 21, 2015, at 18:13 , Quincey Morris >>>> wrote: >

Re: Swift: should computed properties be able to throw exceptions?

2015-08-21 Thread Greg Parker
ferent: the possibility of error is explicit at the call site. Some people think this is better (no invisible execution paths) and some people think it is worse (too noisy). Either way the model is different enough that we don't call it exception handling. The fact that Swift's

Re: Thread-safe singleton with lazy initialisation

2015-08-18 Thread Greg Parker
guarantees. dispatch_once() is the best solution on Apple's platforms. If you don't like dispatch_once() then you could use pthread_once(). If you don't like dispatch_once() nor pthread_once() then you can use PTHREAD_MUTEX_INITIALIZER instead of pthread_mutex_init(). That avoids

Re: Why is overriding unavailable designated initializer of super required?

2015-08-10 Thread Greg Parker
where else later. The compiler's enforcement is for designated initializers because they should be a bottleneck that the compiler can see. Enforcing covers of every superclass convenience initializer would be difficult because it's likely that the compiler can't see them all when compil

Re: Why is overriding unavailable designated initializer of super required?

2015-08-10 Thread Greg Parker
@end or you can implement it to fail at runtime: @interface YourSubclass -(id) init NS_UNAVAILABLE; @end @implementation YourSubclass ... -(id) init { abort(); // or throw or whatever } @end Either approach wil

Re: ARC and Manual Memory Management

2015-08-10 Thread Greg Parker
subsequent changes. For example, the code might look like it supports non-ARC but the retain/release calls are in fact in the wrong places because the only version that is actually tested is the ARC version. GC tried the approach of ignoring retain/r

Re: Can I show different content in different screens? (screensaver)

2015-07-24 Thread Greg Parker
before it is used along all code paths. The compiler recently became smarter at this analysis so it works in more cases. (Downside: you must specify the variable's type.) let myVar: String if let value = something?.somethingElse { myVar = value.stringName } else {

Re: Swift description

2015-07-12 Thread Greg Parker
// I have the lot print("\(c)") // I have the lot debugPrint(c) // I am CustomDebugStringConvertible debugPrint("\(c)") // "I have the lot" Note that (1) string interpolation prefers the non-debug description when available, and (2) debugPrin

Re: Any way to combine for and if-let?

2015-07-07 Thread Greg Parker
caught up. You should file a bug report. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Re: Any way to combine for and if-let?

2015-07-07 Thread Greg Parker
oryEnumerator. It returns AnyObject type, > so wouldn't there have to be an NSURL cast in there somewhere? `for case` uses Swift's pattern matching system, as seen in `switch`. Something like this should work: for case let item as NSURL in enumerator! { … } -- Gre

Re: Loading .dylib problem

2015-07-01 Thread Greg Parker
lding and packaging embedded dylibs. You may want to reconfigure your project to use it. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderato

Re: Swift 2 throws from init()

2015-07-01 Thread Greg Parker
> On Jul 1, 2015, at 5:39 PM, Rick Mann wrote: > >> On Jul 1, 2015, at 17:04 , Greg Parker wrote: >> >> Implicitly unwrapped optional is a good solution for this. The source code >> is no more complicated outside init, and if you get something wrong then you &g

Re: Swift 2 throws from init()

2015-07-01 Thread Greg Parker
ally run, and then (2) cross your fingers really hard. > It seems the only way to handle this is with an Optional (or implicitly > unwrapped Optional) type? Implicitly unwrapped optional is a good solution for this. The source code is no more complicated outside init, and if you get som

Re: Swift and parameter names

2015-07-01 Thread Greg Parker
left, bottom, right. Classic Mac OS was inconsistent. For example, the C struct initializer for Rect was { top, left, bottom, right }, but the initializer function was SetRect(&rect, left, top, right, bottom). -- Greg Parker gpar...@apple.com Runtime Wrangler __

Re: Swift and parameter names

2015-06-29 Thread Greg Parker
ld prefer a different whitespace convention, one with no spaces around the colon in actual parameters. That's a popular convention in Objective-C. Otherwise there is no difference between Objective-C and Swift here. -- Greg Parker gpar...@apple.com Runtime Wrangler __

Re: Simple Swift question

2015-06-29 Thread Greg Parker
mpiler's understanding of the code don't match. For example, in your code above, writing `let url: NSURL = …` moves the error message from the NSURLRequest line to the NSURL line. -- Greg Parker gpar...@apple.com Runtime Wrangler _

Re: Swift and parameter names

2015-06-24 Thread Greg Parker
ou think the caller should be allowed to specify names or not then you can write two overloads, one of which simply calls the other. (I did something like this at one point for CGRect's initializers, allowing any of CGRect(1, 2, 3, 4) or CGRect(x:1, y:2, w:3,

Re: C Assert in BSD Static Library

2015-06-23 Thread Greg Parker
assert() has no effect on NSAssert(). > Are these set in the Library project or the App project that links to them? Assert behavior is usually set when the library is compiled. Sometimes the library will have a runtime variable that affects assert behavior. -- Greg Parker gpar...@

Re: Trouble With NSURLSession...

2015-06-16 Thread Greg Parker
egateQueue: nil) You're inside a class func. `self` is the class object for class HSNDataManager. That class object is not a valid delegate. Presumably you need to pass an instance of HSNDataManager as the delegate object. -- Greg Parker gpar...@apple.com Runtime Wrangler __

Re: Wanted: Elegant way to manage this task

2015-06-09 Thread Greg Parker
wants NSData. If all goes well you'll get NSData compatibility with zero or one extra copies. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: why is this Swift initializer legal

2015-06-07 Thread Greg Parker
that -[NSObject init] does nothing, so it allows this as a performance optimization. NSObject Class Reference: "The init method defined in the NSObject class does no initialization; it simply returns self." There is lots of existing code that would break if we changed that, so w

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-25 Thread Greg Parker
On May 23, 2015, at 4:54 PM, Ken Thomases wrote: > > On May 23, 2015, at 12:54 PM, Jens Alfke wrote: > >> On May 23, 2015, at 9:20 AM, Greg Parker wrote: >>> >>> free() does that sometimes. If zombies doesn't find anything then try guard >>>

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-25 Thread Greg Parker
ase and submitted it as > rdar://21090194 . I’ve also found some workarounds, so I can > get on with my life now… Thanks for the bug report. If your workarounds look relevant to the bug then please describe them there. If the behavior differs or does not differ in debug vs release b

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-23 Thread Greg Parker
oes that sometimes. If zombies doesn't find anything then try guard malloc. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-06 Thread Greg Parker
like me to. > > I'll download 6.3.1 right now. Try Xcode 6.3.1 first. If that still fails then please file a bug report with a sample project that demonstrates the failure. -- Greg Parker gpar...@apple.com Runtime Wrangler

Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-06 Thread Greg Parker
are you using? The static analyzer in Xcode 6.3 has several bugs in retain count analysis and not all of them are fixed in Xcode 6.3.1. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Re: Making an array property without a backing store. How?

2015-04-07 Thread Greg Parker
ty via its accessor methods. `ivar` or `self->ivar` accesses an instance variable's storage directly, bypassing any property accessor methods (synthesized or not) that use that storage. If you have a property and an ivar with the same name then `self.property` and `property`

Re: Where is my bicycle?

2015-04-06 Thread Greg Parker
> On Apr 6, 2015, at 2:20 PM, pscott wrote: > >> On 4/6/2015 12:29 PM, Greg Parker wrote: >> I'm not an expert here, but my understanding is that when Cocoa says >> "character" it usually means "UTF-16 code unit". @"🚲".length == 2, fo

Re: Where is my bicycle?

2015-04-06 Thread Greg Parker
uot;) The implementation of +characterSetWithCharactersInString: does attempt to handle arbitrary code points. It tries to optimize strings that have no "large" code points; my guess is that it has a bug when the string has a mix of both. Please file a bug report. -- Greg Parker

Re: Where is my bicycle?

2015-04-06 Thread Greg Parker
".length == 2, for example. Cocoa's string API designed when Unicode was still a true 16-bit character set. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Re: Why is NSString.UTF8String unavailable in Swift?

2015-03-23 Thread Greg Parker
because String already has a `utf8` property. If you think String.UTF8String should be supported then you should file a bug report. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Re: Official or correct explanation of numbers on the 1st column for every method/function call in process sample?

2015-03-17 Thread Greg Parker
hing else is a description of the instruction's location. (in ) + []. A symbolicated trace may add source file and line numbers. If multiple samples hit the same symbol at different offsets (i.e. they were at different places in the same function) then the

Re: Finding the use of a private API

2015-03-16 Thread Greg Parker
ode to do to improve the store deployment experience. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the m

Re: Finding the use of a private API

2015-03-16 Thread Greg Parker
08`. That will print everything lldb knows about that address and the function it is in. If all has gone well then that will include function names, file names and line numbers, and any inlining involved. -- Greg Parker gpar...@apple.com Runtime Wrangler __

Re: Finding the use of a private API

2015-03-16 Thread Greg Parker
know whether that is done through the review process or through DTS.) -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: iOS App trust on first launch

2015-03-02 Thread Greg Parker
> On Mar 2, 2015, at 12:34 AM, Rick Mann wrote: > > Xcode should handle this for me, in some way. I should be able to bless my > phone to accept apps from my Xcode. Did you file a bug report? -- Greg Parker gpar...@apple.com Runt

Re: Converting from scalar to NSNumber*

2015-02-27 Thread Greg Parker
> On Feb 27, 2015, at 4:46 PM, Rick Mann wrote: > > >> On Feb 27, 2015, at 16:45 , Greg Parker wrote: >> >> >>> On Feb 27, 2015, at 4:28 PM, Rick Mann wrote: >>> >>> I'm updating some older Core Data code in which I made liberal

Re: Converting from scalar to NSNumber*

2015-02-27 Thread Greg Parker
3: warning: ordered comparison between pointer and integer ('NSNumber *' and 'int') if (t.x > 42) printf("bigger"); ~~~ ^ ~~ -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev m

Re: CGFloat and NS_BUILD_32_LIKE_64

2015-02-27 Thread Greg Parker
apple.com/library/mac/documentation/Cocoa/Conceptual/Cocoa64BitGuide/64BitChangesCocoa/64BitChangesCocoa.html#//apple_ref/doc/uid/TP40004247-CH4-SW2 -- Greg Parker gpar...@apple.com Runtime Wrangler ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: BOOL attribute types.

2015-02-16 Thread Greg Parker
ng else: typedef signed char BOOL; If you have sufficient control over the property names, you might be able to assume that a property typed "c" named "foo" with a getter named "isFoo" is a BOOL property. -- Greg Parker gpar...@apple.com Runtime Wrangle

  1   2   3   4   5   6   7   >