RE: Static TableView Leaks...

2012-04-06 Thread Julius Oklamcak
> leak:
> Malloc 48 bytes per incident
> libsystem_c.dylib
> studup

https://devforums.apple.com/message/630695#640345

Known bug in iOS 5.1

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Static TableView Leaks...

2012-04-06 Thread G S
>
> leak:
> Malloc 48 bytes per incident
> libsystem_c.dylib
> studup
>

I've seen this in our project continually, and we're not using ARC.  I
don't remember exactly where this arises at the moment, but strdup leaks
seem to be widely seen but not all that serious (it didn't seem that much
memory was being leaked over time).
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Static TableView Leaks...

2012-04-06 Thread R
Using Xcode 4.3.1 for iOS5 with ARC

Create a new project, single view, static table view.
Don't add anything to the table view just plain as the default.

Go to Product-Profile-Leaks-Profile

INTERACT WITH THE TABLEVIEW - USE YOUR MOUSE TO PUSH THE TABLEVIEW UP
OR DOWN

It leaks.

I was testing my project and found leaks only when displaying static
table views.  I checked in detail and could not find anything wrong.
I commented out all code and it still leaked.

I did the above test and found that all static tableviews in my
project leaked.

Thoughts? A string issue?

leak:
Malloc 48 bytes per incident
libsystem_c.dylib
studup


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Can't get UTI to stick

2012-04-06 Thread C.W. Betts
Try making the UTI UTTypeConformsTo to also include public.data. Also, make 
sure in the Spotlight importer that the app's UTI is being imported.
If you do mdls on a .tgc file, what do you get?
On Apr 2, 2012, at 7:02 PM, Jo Meder wrote:

> Hi,
> 
> I've written a Quick Look generator for one of my app's file types. As part 
> of that I've defined a UTI for that file type. However whatever I do I can't 
> the UTI to stick. I've rebuilt the app, moved it around and used lsregister 
> to kill the Launch Services database and rebuild it. Dumping the Launch 
> Services database shows that the UTI isn't being picked up from the app. It's 
> not happening on 10.5 or 10.6. Here are the relevant parts of my app's plist:
> 
> UTExportedTypeDeclarations
>   
>   
>   UTTypeTagSpecification
>   
>   public.filename-extension
>   
>   tgc
>   TGC
>   
>   
>   UTTypeDescription
>   Terragen 2 Clip document
>   UTTypeConformsTo
>   
>   public.xml
>   
>   UTTypeIdentifier
>   
>   
> uk.co.planetside.Terragen_2.clip
>   
>   
>   
> 
> CFBundleDocumentTypes
>   
>   
>   LSItemContentTypes
>   
>   
> uk.co.planetside.Terragen_2.clip
>   
>   CFBundleOSTypes
>   
>   TG2C
>   
>   CFBundleTypeExtensions
>   
>   TGC
>   tgc
>   
>   CFBundleTypeIconFile
>   TGC.icns
>   CFBundleTypeName
>   Terragen 2 Clip document
>   CFBundleTypeRole
>   Editor
>   
>   
> 
> I have tried commenting out the CFBundleDocumentTypes section so there is 
> just the UTI but that didn't help.
> 
> Can you see something wrong with the above? I'd greatly appreciate any help. 
> So far I've spent longer trying to get this to work than I did on the Quick 
> Look generator itself.
> 
> Regards,
> 
> Jo Meder
> ___
> 
> 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)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/computers57%40hotmail.com
> 
> This email sent to computer...@hotmail.com
> 


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Kevin Perry
Unless I'm mistaken, I don't think Gilles is trying to create a "multi-document 
window" interface like Xcode or Preview. It sounds like he wants a single 
window with a single view (or set of related views) that simply displays the 
contents of multiple files in aggregate.

If that understanding is correct, then NSDocument is not the right model here. 
NSDocument is very specifically about representing a single file or file 
package on disk and encapsulating the algorithms for both writing to and 
reading from the contents of said file or file package on disk. It is not built 
to represent the contents of multiple independent files.

Attempting to shoehorn NSDocument into this use case will buy you very little 
and give you many problems. You're much likely better off using NSOpenPanel, 
NSWindowController, NSFileManager, and NSData directly to open and display 
contents of user-selected files.

On the other hand, if your app creates a visualization that you want to be able 
to save, modify, reopen, etc., then NSDocument is likely what you want, as long 
as you realize the difference between "opening documents" and "importing files 
into a document". The "documents" your app would deal in would be a custom file 
type that your app defines and creates. Files or file packages of this type 
would contain all the data necessary to reconstruct the visualization when 
reopening the document including references to or copies of "imported" files. 
The files that are "imported" into the document would not have NSDocument 
instances of their own (unless you were creating something like Xcode's 
document-within-a-document model). You're still likely going to need to use 
NSOpenPanel, NSFileManager, and NSData yourself to handle importing these files.

-KP

On Apr 6, 2012, at 9:13 AM, Kyle Sluder  wrote:

> On Apr 6, 2012, at 8:29 AM, Gilles Celli  wrote:
> 
>> Versions ? Well here in my case for now I don't need it for my application 
>> since it's kind a viewer / visualizer of the data, I'm not editing or 
>> changing anything
>> to the file…it's a like a PDF viewer but here for data / graphs.
> 
> Fair enough. But you do need to deal with other apps using Versions and file 
> coordination against the files you have open. If you don't follow 
> NSDocument's standard windowing paradigm, it can't perform its normal 
> behavior (like throwing up a sheet alerting to the user that a file has 
> changed).
> 
> Or hell, maybe it can. You might be able to use -windowForSheet to point 
> NSDocument at the shared window.
> 
> 
>> 
>> Maybe you got me wrong but it's simply to append the file's contents that 
>> the user selected in the "Open Panel" and put these selected file contents
>> (=NSString *fileContent1 + *fileContent 2 etc.) to one big appended NSString 
>> *multiContent, then of course call makeWindowControllers
>> to open the NSDocument Window.
> 
> I think you will not want any of your documents to own your window; the 
> window should be owned by the app and -makeWindowControllers would do 
> nothing. You can monitor your NSDocumentController to determine whether to 
> open or close your shared window.
> 
>> 
>> The advantage of using NSDocument are multiple, and mainly printing to PDF 
>> works great etc. so it should be possible (since it's possible on Windows XP 
>> ;-)
> 
> Of course you can do pretty much anything on OS X that you can do on Windows. 
> But OS X's frameworks are designed to discourage bad decisions. The bias 
> inherent in the frameworks produces a consistency across apps that users 
> appreciate.
> 
> Just because something is easy on some other platform does not mean it should 
> be easy on OS X.
> 
> That said, it sounds like you have a decent use case that won't fight the 
> framework too badly.
> 
> --Kyle Sluder
> 
> ___
> 
> 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)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/kperry%40apple.com
> 
> This email sent to kpe...@apple.com


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Kyle Sluder
On Apr 6, 2012, at 8:29 AM, Gilles Celli  wrote:

> Versions ? Well here in my case for now I don't need it for my application 
> since it's kind a viewer / visualizer of the data, I'm not editing or 
> changing anything
> to the file…it's a like a PDF viewer but here for data / graphs.

Fair enough. But you do need to deal with other apps using Versions and file 
coordination against the files you have open. If you don't follow NSDocument's 
standard windowing paradigm, it can't perform its normal behavior (like 
throwing up a sheet alerting to the user that a file has changed).

Or hell, maybe it can. You might be able to use -windowForSheet to point 
NSDocument at the shared window.


> 
> Maybe you got me wrong but it's simply to append the file's contents that the 
> user selected in the "Open Panel" and put these selected file contents
> (=NSString *fileContent1 + *fileContent 2 etc.) to one big appended NSString 
> *multiContent, then of course call makeWindowControllers
> to open the NSDocument Window.

I think you will not want any of your documents to own your window; the window 
should be owned by the app and -makeWindowControllers would do nothing. You can 
monitor your NSDocumentController to determine whether to open or close your 
shared window.

> 
> The advantage of using NSDocument are multiple, and mainly printing to PDF 
> works great etc. so it should be possible (since it's possible on Windows XP 
> ;-)

Of course you can do pretty much anything on OS X that you can do on Windows. 
But OS X's frameworks are designed to discourage bad decisions. The bias 
inherent in the frameworks produces a consistency across apps that users 
appreciate.

Just because something is easy on some other platform does not mean it should 
be easy on OS X.

That said, it sounds like you have a decent use case that won't fight the 
framework too badly.

--Kyle Sluder

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Gilles Celli
Versions ? Well here in my case for now I don't need it for my application 
since it's kind a viewer / visualizer of the data, I'm not editing or changing 
anything
to the file…it's a like a PDF viewer but here for data / graphs.

Maybe you got me wrong but it's simply to append the file's contents that the 
user selected in the "Open Panel" and put these selected file contents
(=NSString *fileContent1 + *fileContent 2 etc.) to one big appended NSString 
*multiContent, then of course call makeWindowControllers
to open the NSDocument Window.

The advantage of using NSDocument are multiple, and mainly printing to PDF 
works great etc. so it should be possible (since it's possible on Windows XP ;-)

Gilles


On Apr 6, 2012, at 4:59 PM, Kyle Sluder wrote:

> On Apr 6, 2012, at 7:39 AM, Gilles Celli  wrote:
> 
>> It works and if a user opens multiple files there are of course separate 
>> files document windows, but I would prefer only one window:
> 
> Question: how would this work with Versions?
> 
> --Kyle Sluder


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Kyle Sluder
On Apr 6, 2012, at 7:39 AM, Gilles Celli  wrote:

> It works and if a user opens multiple files there are of course separate 
> files document windows, but I would prefer only one window:

Question: how would this work with Versions?

--Kyle Sluder
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Gilles Celli
Hi all,

My document-based application on Mac OS X reads ASCII data file to draw graphs 
based on date/time and y-values.

It reads the file contents by overriding readFromURL:ofType:error:
...
NSString *fileContents = [[NSString alloc] initWithContentsOfURL:absoluteURL
  
encoding:NSISOLatin1StringEncoding
 error:outError];
….

It works and if a user opens multiple files there are of course separate files 
document windows, but I would prefer only one window:

I want to combine the selected multiple ASCII files from my app's Open Panel  
*without creating different windows*
but only one window so that we get just one big file to draw.
Of course an NSMutableArray is needed to add the different NSString then 
combine them etc.

So my question is:

Is it possible to combine multiple file contents for an NSDocument based app 
and if yes which method should I override, 
or is there an NSApplication method to override ?

Any help is greatly appreciated.

Cheers,

Gilles
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: iOS drawer-style interaction

2012-04-06 Thread Scott Andrew
What about using a UIPanGestureRecognizer? I didn't see anything in the docs 
that says a swipe get's continuous feedback. A UIPanGestureRecognizer gives 
continuous feedback during the drag.

Scott

On Apr 5, 2012, at 11:45 PM, Rick Mann wrote:

> I'm trying to implement a drawer of sorts. Initially I added a down-swipe 
> gesture recognizer, but I'd like the drawer edge to track the user's finger. 
> Is there a way I can "hook in" to the recognizer to continuously track the 
> finger after recognition?
> 
> TIA,
> -- 
> Rick
> 
> 
> ___
> 
> 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)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com
> 
> This email sent to scottand...@roadrunner.com


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iOS 5: AVFoundation and MPMediaItemPropertyAssetURL

2012-04-06 Thread Rhythmic Fistman
On 6 April 2012 01:56, John Michael Zorko  wrote:
>
> Hello, all ...
>
> I'm experimenting with making AVFoundation play local [purchased from] iTunes 
> content on the device. I can set up an MPMediaQuery to fetch the content like 
> so:
>
>    MPMediaQuery *query = [[[MPMediaQuery alloc] init] autorelease];
>    [query addFilterPredicate:[MPMediaPropertyPredicate 
> predicateWithValue:[NSNumber numberWithInt:MPMediaTypeTVShow] 
> forProperty:MPMediaItemPropertyMediaType]];
>
> ... and if I go through the query's items array, I can get the name and asset 
> URL:
>
>    for (MPMediaItem *item in [query items])
>    {
>        NSString *name = [item valueForProperty:MPMediaItemPropertyTitle];
>        NSURL *url = [item valueForProperty:MPMediaItemPropertyAssetURL];
>
>        NSLog(@" video name: %@ url: %@", name, url);
>    }
>
> "video name: Plague of Babies / Bloaty's Pizza Hog url: 
> ipod-library://item/item.m4v?id=4414454911022643168"
>
> I then make an AVURLAsset from the URL and ask AVFoundation to load said URL 
> (ipod-library://item/item.m4v?id=4414454911022643168) via AVURLAsset 
> loadValuesAsynchronouslyForKeys. The block is called, I make an AVPlayerItem, 
> AVPlayer, attach the player to an AVPlayerLayer, etc. Everything seems cool. 
> I call play once the AVPlayerItem's status is AVPlayerItemStatusReadyToPlay. 
> I even see the playbackLikelyToKeepUp. However, nothing plays -- I don't see 
> any errors, just nothing. Am I missing something? This same approach works 
> well when playing a video from the application bundle as well as videos from 
> the interwebz ...

iTunes purchased movies are DRMed, although film clips seem to be DRM free.
You should be seeing some indication of that somewhere, e.g. via
AVAsset.hasProtectedContent or zero tracks.

RF

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Displaying an arbitrary unicode character using CGContextShowTextAtPoint or CGContextShowGlyphsAtPoint

2012-04-06 Thread Rhythmic Fistman
On 30 March 2012 18:18, Jeff Schriebman  wrote:
> I need to display the upwards arrow character in a specific position in a 
> view.
> The unicode equivalence is U+2B06 and in UTF-8 it is E2 AC 86.
>
> I can successfully display it in Xcode on the console using NSLog(@"This is 
> an up arrow character \u2B06");
>
> I have not found a way to use CGContextShowTextAtPoint to easily display such 
> a character and the examples I have found using CGContextShowGlyphsAtPoint() 
> seem to require me to use a font containing the upwards arrow glyph. Is there 
> a generic all inclusive unicode font? What is the right approach to this 
> issue? Suggestions are appreciated.

I like CoreText's CTFontGetGlyphsForCharacters (10.5) &
CTFontDrawGlyphs (10.7!).

If you can live with it not working on 10.6 then you're good.

RF

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com