Sending a message to a Toll free bridge

2013-11-25 Thread Gerriet M. Denkmann
The documentation states: CFArray is “toll-free bridged” with its Cocoa 
Foundation counterpart, NSArray. This means that the Core Foundation type is 
interchangeable in function or method calls with the bridged Foundation object. 
Therefore, in a method where you see an NSArray * parameter, you can pass in a 
CFArrayRef

Does this also mean: any message you can send to an NSArray, you can send also 
to an CFArrayRef?

NSFont *fo = [ NSFont fontWithName: @Thonburi size: 0 ];
CTFontRef font = (__bridge CTFontRef)fo;
CFArrayRef tags = CTFontCopyAvailableTables ( font, 0 );
NSArray *tagsArray = CFBridgingRelease(tags);
// next  line prints: class __NSCFArray count: 18
NSLog(@%s class %@ count: %lu,__FUNCTION__, [tagsArray class], 
[tagsArray count]);

So sending messages to an CFArrayRef seems to be ok. Or not?

But then this line crashes:

NSString *tagDescription = [ tagsArray description ];

My mistake? My false assumption?

Gerriet.



___

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: Sending a message to a Toll free bridge

2013-11-25 Thread Stephen J. Butler
I don't believe that the array that CTFontCopyAvailableTables() returns
contains CFTypes. So yes, CFArray is bridgeable. But in this case that
isn't so useful since the values aren't.


On Mon, Nov 25, 2013 at 3:23 AM, Gerriet M. Denkmann
gerr...@mdenkmann.dewrote:

 The documentation states: CFArray is “toll-free bridged” with its Cocoa
 Foundation counterpart, NSArray. This means that the Core Foundation type
 is interchangeable in function or method calls with the bridged Foundation
 object. Therefore, in a method where you see an NSArray * parameter, you
 can pass in a CFArrayRef

 Does this also mean: any message you can send to an NSArray, you can send
 also to an CFArrayRef?

 NSFont *fo = [ NSFont fontWithName: @Thonburi size: 0 ];
 CTFontRef font = (__bridge CTFontRef)fo;
 CFArrayRef tags = CTFontCopyAvailableTables ( font, 0 );
 NSArray *tagsArray = CFBridgingRelease(tags);
 // next  line prints: class __NSCFArray count: 18
 NSLog(@%s class %@ count: %lu,__FUNCTION__, [tagsArray class],
 [tagsArray count]);

 So sending messages to an CFArrayRef seems to be ok. Or not?

 But then this line crashes:

 NSString *tagDescription = [ tagsArray description ];

 My mistake? My false assumption?

 Gerriet.



 ___

 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/stephen.butler%40gmail.com

 This email sent to stephen.but...@gmail.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

iOS screen physical size (or px density)

2013-11-25 Thread Roland King
Is there yet a supported way of finding out the actual screen size (or 
equivalently pixel density) on an iOS screen? 

I have an app, uses autolayout, works fine on iPhone (one storyboard), iPad 
(another storyboard) and mostly looks fine between iPad and iPad mini. One 
screen however has a number of test 'cards' on it. On the phone one card == one 
screen looks great. On a full-sized iPad, about 6 to a page is clear, on a mini 
however 6 is not ideal and 4, or 3, looks much better and is much clearer to 
test. That's one of the fairly rare cases where one size doesn't fit all and 
knowing the actual screen dimensions would make a better user experience. 

I know there was lots of chat about this when the mini came out, there wasn't 
anything then and I don't want to do one of the version or device name hacks. 
Is there yet an API point for this? 
___

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: CVPixelBufferCreateWithPlanarBytes does not execute callback when released

2013-11-25 Thread Matthieu Bouron
On Sun, Nov 10, 2013 at 10:50 PM, Matthieu Bouron matthieu.bou...@gmail.com
 wrote:

 Hello,

 First of all, sorry in advance if i'm not addressing the right mailing
 list.

 I'm currently using the CVPixelBufferRef API and more precisely
 the CVPixelBufferCreateWithPlanarBytes function so I can use my own video
 buffers.

 This function let the user provide a callback so the user can provide
 a function to free its buffer on release. However I can't get my own
 callback to be executed which leads to severe memory leaks in my
 application.

 You can find attached to this email, an example to reproduce the issue.
 Note that the first example with CVPixelBufferCreateWithBytes works but
 the CVPixelBufferCreateWithPlanarBytes one don't.
 Maybe i'm missing something ?

 I'm facing this issue on OSX 10.9.

 To compile the example:
 gcc -framework CoreVideo test_cvbuffer.m -o test_cvbuffer

 Thanks in advance for your help.


ping

[...]
___

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: Sending a message to a Toll free bridge

2013-11-25 Thread Jean-Daniel Dupas

Le 25 nov. 2013 à 10:23, Gerriet M. Denkmann gerr...@mdenkmann.de a écrit :

 The documentation states: CFArray is “toll-free bridged” with its Cocoa 
 Foundation counterpart, NSArray. This means that the Core Foundation type is 
 interchangeable in function or method calls with the bridged Foundation 
 object. Therefore, in a method where you see an NSArray * parameter, you can 
 pass in a CFArrayRef
 
 Does this also mean: any message you can send to an NSArray, you can send 
 also to an CFArrayRef?
 
   NSFont *fo = [ NSFont fontWithName: @Thonburi size: 0 ];
   CTFontRef font = (__bridge CTFontRef)fo;
   CFArrayRef tags = CTFontCopyAvailableTables ( font, 0 );
   NSArray *tagsArray = CFBridgingRelease(tags);
   // next  line prints: class __NSCFArray count: 18
   NSLog(@%s class %@ count: %lu,__FUNCTION__, [tagsArray class], 
 [tagsArray count]);
 
 So sending messages to an CFArrayRef seems to be ok. Or not?
 
 But then this line crashes:
 
   NSString *tagDescription = [ tagsArray description ];
 
 My mistake? My false assumption?

You just hit a corner case. Toll free bridging is supported only for 
collections of objects compatible with id. 
CTFontCopyAvailableTables() is one of the very few API that returns a 
CFArrayRef that contains plain int value, and so cannot be safely converted to 
NSArray.

An other well known corner case is when you try to cast a CFMutableDictionary 
into a NSMutableDictionary. The later requires that key are copyable objects 
while the former support other types of keys.

Except such cases, you should be able to call any NSArray method on a 
CFArrayRef.

-- Jean-Daniel





___

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 screen physical size (or px density)

2013-11-25 Thread Steve Christensen
I haven't seen anything that directly returns this information. Given that, it 
might be better to take the approach of choosing the number of cards that look 
good on an iPad mini and not worrying so much that there are too few on a 
full-sized iPad.


On Nov 25, 2013, at 4:40 AM, Roland King r...@rols.org wrote:

 Is there yet a supported way of finding out the actual screen size (or 
 equivalently pixel density) on an iOS screen? 
 
 I have an app, uses autolayout, works fine on iPhone (one storyboard), iPad 
 (another storyboard) and mostly looks fine between iPad and iPad mini. One 
 screen however has a number of test 'cards' on it. On the phone one card == 
 one screen looks great. On a full-sized iPad, about 6 to a page is clear, on 
 a mini however 6 is not ideal and 4, or 3, looks much better and is much 
 clearer to test. That's one of the fairly rare cases where one size doesn't 
 fit all and knowing the actual screen dimensions would make a better user 
 experience. 
 
 I know there was lots of chat about this when the mini came out, there wasn't 
 anything then and I don't want to do one of the version or device name hacks. 
 Is there yet an API point for this?


___

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

I need an entry point for live video grabbing

2013-11-25 Thread Motti Shneor
Hello everyone. 

This seems a novice question, but I have scanned Apple Mac-Dev-Center site and 
I dived into all kinds of documentation, to no avail. 
It seems that some basic functionality that was once beautifully covered by the 
grand QuickTime API-set has split into so many parts of the system I can't 
figure out how to do it anymore. 
I'm re-writing an application I did 12 years ago, on MacOS 9, QuickTime 
Sequence-Grabber APIs and the first versions of Carbon. 

My task:
-
I need to continuously grab frames from an IIDC/DCam camera connected to the 
Mac via FireWire (iEEE1394), and display them on the application window, 
scaled,  somewhat enhanced (contrast, edges), with a grid overlay drawn on 
them. Further, I need to allow a user to draw geometrical objects on the live 
image, and measure distances and curves clicking over the live video view.
-

I neither need to record video to disk nor to compress the incoming video. Just 
display it at the best quality and frame-rate I can. The camera is mounted on a 
Microscope, and the need for live-image is for the operator to be able to focus 
the microscope with on-screen feedback, or move the objective to search for 
some microscopic object.

The original implementation did this without problems on 1999 Macs, using 
QuickTime SG (Sequence-Grabber) APIs for grabbing video, QuickDraw for drawing 
over the actual GWorld's. I also converted the color spaces by hand, and 
optimized here and there, until I was able to reach 15fps with a 2mega-pixel 
camera, on a PPC G3 iMac of that time.

Now --- not only I can't find any API set that will allow me to grab video from 
camera, I find so many frameworks involved in Video that I can't find the 
connection points between them. Embarrassingly complicated and incomplete APIs.

I know I'll need Quartz to draw over the image. I know CoreGraphics will be 
involved in the layering and CoreImage for image-enhancements. I don't know If 
I need CoreVideo, although it is about manipulating video as it is displayed. I 
don't know If I need QTKit or AVFoundation, or something else, and where does 
OpenGL get in the middle.

There is NO SAMPLE PROGRAM now, in in the whole of Apple's developer site to 
simply grab frames from the iSight (internal camera of the Mac) and display 
them! The last thing I have (BrideOfMungGrab) does not compile anymore with 
MacOS 10.7 SDK. In the past, the same API was used for grabbing from iSight, 
DCAM/IIDCS cameras, and DV-Cam --- today I don't know.

I absolutely need a pointer, or I'm missing something big as an elephant. 

Help please?


Motti Shneor, 
---
ceterum censeo microsoftiem delendam esse
---




___

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: I need an entry point for live video grabbing

2013-11-25 Thread Kyle Sluder
You want AVCaptureSession.

--Kyle Sluder

 On Nov 25, 2013, at 9:53 AM, Motti Shneor su...@bezeqint.net wrote:
 
 Hello everyone. 
 
 This seems a novice question, but I have scanned Apple Mac-Dev-Center site 
 and I dived into all kinds of documentation, to no avail. 
 It seems that some basic functionality that was once beautifully covered by 
 the grand QuickTime API-set has split into so many parts of the system I 
 can't figure out how to do it anymore. 
 I'm re-writing an application I did 12 years ago, on MacOS 9, QuickTime 
 Sequence-Grabber APIs and the first versions of Carbon. 
 
 My task:
 -
 I need to continuously grab frames from an IIDC/DCam camera connected to the 
 Mac via FireWire (iEEE1394), and display them on the application window, 
 scaled,  somewhat enhanced (contrast, edges), with a grid overlay drawn on 
 them. Further, I need to allow a user to draw geometrical objects on the live 
 image, and measure distances and curves clicking over the live video view.
 -
 
 I neither need to record video to disk nor to compress the incoming video. 
 Just display it at the best quality and frame-rate I can. The camera is 
 mounted on a Microscope, and the need for live-image is for the operator to 
 be able to focus the microscope with on-screen feedback, or move the 
 objective to search for some microscopic object.
 
 The original implementation did this without problems on 1999 Macs, using 
 QuickTime SG (Sequence-Grabber) APIs for grabbing video, QuickDraw for 
 drawing over the actual GWorld's. I also converted the color spaces by hand, 
 and optimized here and there, until I was able to reach 15fps with a 
 2mega-pixel camera, on a PPC G3 iMac of that time.
 
 Now --- not only I can't find any API set that will allow me to grab video 
 from camera, I find so many frameworks involved in Video that I can't find 
 the connection points between them. Embarrassingly complicated and incomplete 
 APIs.
 
 I know I'll need Quartz to draw over the image. I know CoreGraphics will be 
 involved in the layering and CoreImage for image-enhancements. I don't know 
 If I need CoreVideo, although it is about manipulating video as it is 
 displayed. I don't know If I need QTKit or AVFoundation, or something else, 
 and where does OpenGL get in the middle.
 
 There is NO SAMPLE PROGRAM now, in in the whole of Apple's developer site to 
 simply grab frames from the iSight (internal camera of the Mac) and display 
 them! The last thing I have (BrideOfMungGrab) does not compile anymore with 
 MacOS 10.7 SDK. In the past, the same API was used for grabbing from iSight, 
 DCAM/IIDCS cameras, and DV-Cam --- today I don't know.
 
 I absolutely need a pointer, or I'm missing something big as an elephant. 
 
 Help please?
 
 
 Motti Shneor, 
 ---
 ceterum censeo microsoftiem delendam esse
 ---

___

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

Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann
Dynamically at runtime, I'd like to put a fixed banner across the top of a 
UITableViewController scene with some status information. I want this banner to 
remain fixed at the top, and for the UITableView to live in a frame below it.

IB doesn't let you construct this. I wrote this as a bug/enhancement request, 
and it came back that I should embed a sub view controller in it. But this is 
incredibly cumbersome, as it forces me to create another view controller to 
contain it.

In the past, at run time (during view instantiation), I've inserted a container 
view as a parent of my UITableView, and pulled some shenanigans to trick the 
UITableViewController parent class to refer to the table view while my 
controller subclass's view property points to the top-level view. This has 
worked, but I don't like doing end-runs around iOS like that.

I could possibly do something with autolayout constraints and and offsets to 
put my banner view inside my table view, but that seems inelegant, too.

What do you guys suggest?

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Kyle Sluder
 On Nov 25, 2013, at 6:08 PM, Rick Mann rm...@latencyzero.com wrote:
 
 Dynamically at runtime, I'd like to put a fixed banner across the top of a 
 UITableViewController scene with some status information. I want this banner 
 to remain fixed at the top, and for the UITableView to live in a frame below 
 it.
 
 IB doesn't let you construct this. I wrote this as a bug/enhancement request, 
 and it came back that I should embed a sub view controller in it. But this is 
 incredibly cumbersome, as it forces me to create another view controller to 
 contain it.

Except that’s precisely what UIViewController expects.

Let’s say you have a navigation controller. It is in charge of positioning its 
child view controllers’ views. You can’t intervene and say “sorry nav 
controller, but that table view should be 40pt below where you want to put it.” 
That’s not how view controller containment works.

 
 What do you guys suggest?
 

Use an custom container view controller, and watch the WWDC videos on view 
controller containment to learn why this is the right thing to do.

--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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 18:16 , Kyle Sluder k...@ksluder.com wrote:

 Use an custom container view controller, and watch the WWDC videos on view 
 controller containment to learn why this is the right thing to do.

Can I put an unsubclasses UITableViewController in there, and let my container 
VC be the dataSource and delegate?

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Luther Baker
Dropping a UITableView inside of a UIViewController that conforms to the 
tableview's delegate and datasource is literally as easy as it sounds ... and 
immensely more flexible.

UITableViewController is convenient but at all necessary.

On Nov 25, 2013, at 8:16 PM, Kyle Sluder k...@ksluder.com wrote:

 On Nov 25, 2013, at 6:08 PM, Rick Mann rm...@latencyzero.com wrote:
 
 Dynamically at runtime, I'd like to put a fixed banner across the top of a 
 UITableViewController scene with some status information. I want this banner 
 to remain fixed at the top, and for the UITableView to live in a frame below 
 it.
 
 IB doesn't let you construct this. I wrote this as a bug/enhancement 
 request, and it came back that I should embed a sub view controller in it. 
 But this is incredibly cumbersome, as it forces me to create another view 
 controller to contain it.
 
 Except that’s precisely what UIViewController expects.
 
 Let’s say you have a navigation controller. It is in charge of positioning 
 its child view controllers’ views. You can’t intervene and say “sorry nav 
 controller, but that table view should be 40pt below where you want to put 
 it.” That’s not how view controller containment works.
 
 
 What do you guys suggest?
 
 Use an custom container view controller, and watch the WWDC videos on view 
 controller containment to learn why this is the right thing to do.
 
 --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/lutherbaker%40gmail.com
 
 This email sent to lutherba...@gmail.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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 18:40 , Luther Baker lutherba...@gmail.com wrote:

 UITableViewController is convenient but at all necessary.

Is there a missing not in there?

It's necessary if you want to use the static and dynamic cell creation stuff in 
IB.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Kyle Sluder
 On Nov 25, 2013, at 6:33 PM, Rick Mann rm...@latencyzero.com wrote:

 
 
 On Nov 25, 2013, at 18:16 , Kyle Sluder k...@ksluder.com wrote:
 
 Use an custom container view controller, and watch the WWDC videos on view 
 controller containment to learn why this is the right thing to do.
 
 Can I put an unsubclasses UITableViewController in there, and let my 
 container VC be the dataSource and delegate?

Sure, you could, but why? Then your container VC has to reach in to your table 
view controller and point its table view at itself.

Why not just do the sensible thing and make the container VC responsible for 
managing the bar and positioning of the table view relative to it, leaving the 
management of the table view itself to the child table view controller?

If you have other objects that need to access the table view controller, it is 
not hard to expose it as a public property of your container VC.

--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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann
I'm not convinced this is the best way. I can't drag-connect the table view 
controller's delegate and dataSource in IB when it's done this way.

On Nov 25, 2013, at 18:40 , Luther Baker lutherba...@gmail.com wrote:

 Dropping a UITableView inside of a UIViewController that conforms to the 
 tableview's delegate and datasource is literally as easy as it sounds ... and 
 immensely more flexible.
 
 UITableViewController is convenient but at all necessary.
 
 On Nov 25, 2013, at 8:16 PM, Kyle Sluder k...@ksluder.com wrote:
 
 On Nov 25, 2013, at 6:08 PM, Rick Mann rm...@latencyzero.com wrote:
 
 Dynamically at runtime, I'd like to put a fixed banner across the top of a 
 UITableViewController scene with some status information. I want this 
 banner to remain fixed at the top, and for the UITableView to live in a 
 frame below it.
 
 IB doesn't let you construct this. I wrote this as a bug/enhancement 
 request, and it came back that I should embed a sub view controller in it. 
 But this is incredibly cumbersome, as it forces me to create another view 
 controller to contain it.
 
 Except that’s precisely what UIViewController expects.
 
 Let’s say you have a navigation controller. It is in charge of positioning 
 its child view controllers’ views. You can’t intervene and say “sorry nav 
 controller, but that table view should be 40pt below where you want to put 
 it.” That’s not how view controller containment works.
 
 
 What do you guys suggest?
 
 Use an custom container view controller, and watch the WWDC videos on view 
 controller containment to learn why this is the right thing to do.
 
 --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/lutherbaker%40gmail.com
 
 This email sent to lutherba...@gmail.com


-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 18:48 , Kyle Sluder k...@ksluder.com wrote:

 Sure, you could, but why? Then your container VC has to reach in to your 
 table view controller and point its table view at itself.
 
 Why not just do the sensible thing and make the container VC responsible for 
 managing the bar and positioning of the table view relative to it, leaving 
 the management of the table view itself to the child table view controller?
 
 If you have other objects that need to access the table view controller, it 
 is not hard to expose it as a public property of your container VC.

So, I have basically one property that needs to be reflected at the top of the 
table. You're saying it's best to make a whole, separate view controller just 
to do this? This doesn't seem useful at all, especially since in days of old I 
could easily make a view controller that controlled a view, and manage a table 
view as one of the many subviews within that.

And, I've done it as I described, by ensuring self.tableView always returned 
the table view, and self.view returned the containing view.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Kyle Sluder
 On Nov 25, 2013, at 6:51 PM, Rick Mann rm...@latencyzero.com wrote:

 
 
 On Nov 25, 2013, at 18:48 , Kyle Sluder k...@ksluder.com wrote:
 
 Sure, you could, but why? Then your container VC has to reach in to your 
 table view controller and point its table view at itself.
 
 Why not just do the sensible thing and make the container VC responsible for 
 managing the bar and positioning of the table view relative to it, leaving 
 the management of the table view itself to the child table view controller?
 
 If you have other objects that need to access the table view controller, it 
 is not hard to expose it as a public property of your container VC.
 
 So, I have basically one property that needs to be reflected at the top of 
 the table. You're saying it's best to make a whole, separate view controller 
 just to do this?

If you want to use UITableViewController, yes. Which, as you mentioned, is the 
only way to get static cell support in a storyboard.

 This doesn't seem useful at all, especially since in days of old I could 
 easily make a view controller that controlled a view, and manage a table view 
 as one of the many subviews within that.

You can still do that if you like. My suggestions held the assumption that you 
wanted to continue using UITVC.

--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: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Luther Baker
Maybe I am missing something - but I just created a new Tab based project
and dropped a UITableView directly on the FirstViewController, under the
View node in the expanding tree. If I right click on the UITableView, I
see both the delegate and datasource outlets. I can click them and easily
drag/connect to the parent First View Controller.

Do you mean something else?


On Mon, Nov 25, 2013 at 8:48 PM, Rick Mann rm...@latencyzero.com wrote:

 I'm not convinced this is the best way. I can't drag-connect the table
 view controller's delegate and dataSource in IB when it's done this way.

 On Nov 25, 2013, at 18:40 , Luther Baker lutherba...@gmail.com wrote:

  Dropping a UITableView inside of a UIViewController that conforms to the
 tableview's delegate and datasource is literally as easy as it sounds ...
 and immensely more flexible.
 
  UITableViewController is convenient but at all necessary.
 
  On Nov 25, 2013, at 8:16 PM, Kyle Sluder k...@ksluder.com wrote:
 
  On Nov 25, 2013, at 6:08 PM, Rick Mann rm...@latencyzero.com wrote:
 
  Dynamically at runtime, I'd like to put a fixed banner across the top
 of a UITableViewController scene with some status information. I want this
 banner to remain fixed at the top, and for the UITableView to live in a
 frame below it.
 
  IB doesn't let you construct this. I wrote this as a bug/enhancement
 request, and it came back that I should embed a sub view controller in it.
 But this is incredibly cumbersome, as it forces me to create another view
 controller to contain it.
 
  Except that’s precisely what UIViewController expects.
 
  Let’s say you have a navigation controller. It is in charge of
 positioning its child view controllers’ views. You can’t intervene and say
 “sorry nav controller, but that table view should be 40pt below where you
 want to put it.” That’s not how view controller containment works.
 
 
  What do you guys suggest?
 
  Use an custom container view controller, and watch the WWDC videos on
 view controller containment to learn why this is the right thing to do.
 
  --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/lutherbaker%40gmail.com
 
  This email sent to lutherba...@gmail.com


 --
 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/archive%40mail-archive.com

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

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Luther Baker
Yes, thanks for inserting the not.

If I drop a UITableView on an existing UIViewController in the default
storyboard for a new Tab based application, I can click on the UITableView
and select from static cells or dynamic content in the TableView
content section in the right hand Utilities pane.

Does the UITableViewController provide something more I'm not seeing?



On Mon, Nov 25, 2013 at 8:43 PM, Rick Mann rm...@latencyzero.com wrote:


 On Nov 25, 2013, at 18:40 , Luther Baker lutherba...@gmail.com wrote:

  UITableViewController is convenient but at all necessary.

 Is there a missing not in there?

 It's necessary if you want to use the static and dynamic cell creation
 stuff in IB.

 --
 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/archive%40mail-archive.com

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

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 21:11 , Luther Baker lutherba...@gmail.com wrote:

 Maybe I am missing something - but I just created a new Tab based project
 and dropped a UITableView directly on the FirstViewController, under the
 View node in the expanding tree. If I right click on the UITableView, I
 see both the delegate and datasource outlets. I can click them and easily
 drag/connect to the parent First View Controller.
 
 Do you mean something else?

You can't put a UITableViewController into a Container View, and link from the 
UITVC back to the containing view controller.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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