I have a problem.
first,I have a NSArray like this:
(NSMutableArray *)currentCanMoveAndDeleteCellArray {
NSInteger count = [self.contentCollectionView numberOfItemsInSection:0];
NSMutableArray *currentCells = [NSMutableArray arrayWithCapacity:count];
for (int index = 0 ; index < count; ++index) {
UICollectionViewCell *cell = [self.contentCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
if(cell) {
[currentCells addObject:[self.contentCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]]];
}
}
return currentCells;
}
then I want to get their last subviews, I use kvc get subviews like this.
[self.currentCanMoveAndDeleteCellArray valueForKeyPath:#"subviews"]
and I got:
<__NSArrayI 0x1710793c0>(
<__NSArrayM 0x17405a670>(
<UIView: 0x155de9020; frame = (0 0; 80 30); gestureRecognizers = <NSArray: 0x170248f40>; layer = <CALayer: 0x1702363a0>>,
<UILabel: 0x155e524d0; frame = (70 -10; 20 20); clipsToBounds = YES; tag = 123; gestureRecognizers = <NSArray: 0x17405a520>; layer = <_UILabelLayer: 0x17409f540>>
)
,
<__NSArrayM 0x17405cf80>(
<UIView: 0x155e7cbf0; frame = (0 0; 80 30); gestureRecognizers = <NSArray: 0x17405d3a0>; layer = <CALayer: 0x174431a40>>,
<UILabel: 0x155e7ceb0; frame = (70 -10; 20 20); clipsToBounds = YES; tag = 123; gestureRecognizers = <NSArray: 0x17405d400>; layer = <_UILabelLayer: 0x17409f9a0>>
)
,
<__NSArrayM 0x17405f6b0>(
<UIView: 0x155e7da80; frame = (0 0; 80 30); gestureRecognizers = <NSArray: 0x17405faa0>; layer = <CALayer: 0x174433440>>,
<UILabel: 0x155e7dd40; frame = (70 -10; 20 20); clipsToBounds = YES; tag = 123; gestureRecognizers = <NSArray: 0x17405fb00>; layer = <_UILabelLayer: 0x174282f30>>
)
<__NSArrayM 0x174240990>(
<UIView: 0x155e7e150; frame = (0 0; 80 30); gestureRecognizers = <NSArray: 0x174240d80>; layer = <CALayer: 0x174433e60>>,
<UILabel: 0x155e7e410; frame = (70 -10; 20 20); clipsToBounds = YES; tag = 123; gestureRecognizers = <NSArray: 0x174240de0>; layer = <_UILabelLayer: 0x174283610>>
)
,
<__NSArrayM 0x174241c50>(
<UIView: 0x155e7ec30; frame = (0 0; 80 30); gestureRecognizers = <NSArray: 0x174242040>; layer = <CALayer: 0x174434880>>,
<UILabel: 0x155e7eef0; frame = (70 -10; 20 20); clipsToBounds = YES; tag = 123; gestureRecognizers = <NSArray: 0x1742420a0>; layer = <_UILabelLayer: 0x174283cf0>>
)
,
<__NSArrayM 0x174242f10>(
<UIView: 0x155e7f710; frame = (0 0; 80 30); gestureRecognizers = <NSArray: 0x174243300>; layer = <CALayer: 0x1744352a0>>,
<UILabel: 0x155e7f9d0; frame = (70 -10; 20 20); clipsToBounds = YES; tag = 123; gestureRecognizers = <NSArray: 0x174243360>; layer = <_UILabelLayer: 0x1742843d0>>
)
)
who can tell me how to got last subview.
I tried to write:
[self.currentCanMoveAndDeleteCellArray valueForKeyPath:#"subviews.#lastObject"]
but, you know that it isn't result that i want.
You should use UICollectionViewCell class in array.
After, you can get subview.
- (NSMutableArray *)currentCanMoveAndDeleteCellArray {
NSInteger count = [self.contentCollectionView numberOfItemsInSection:0];
self.currentCells = [NSMutableArray arrayWithCapacity:count];
for (int index = 0 ; index < count; ++index) {
UICollectionViewCell *cell = [self.contentCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
if(cell) {
[ self.currentCells addObject:cell]; }
} return self.currentCells;
}
-(void)getCell{
UICollectionViewCell *cell = [ self.currentCells objectAtIndex:_index];
for (UIView * view in [cell subviews]) {
NSLog(#"%#",view);
}
}
Related
I am trying to loop all my subviews and print them in NSLog.
I have developed this recursive method:
- (void)allSubViews:(UIView*)mainV
{
for (UIView *view in mainV.subviews) {
NSLog(#"%#", view);
if ([[view subviews]count]>0) {
[self allSubViews:view];
}
}
}
which I call from MainViewController.m:
[self allSubViews:self.myView];
The result is:
2015-09-12 11:18:48.919 Profile-Statistics[3153:506562] <_UILayoutGuide: 0x7fc70bf1c330; frame = (0 0; 0 0); hidden = YES;
layer = >
2015-09-12 11:18:48.919 Profile-Statistics[3153:506562] <_UILayoutGuide: 0x7fc70bf1ced0; frame = (0 0; 0 0); hidden = YES;
layer = >
My View has Top and Bottom Layout Guide and a View which has 3 UIButtons, 1 ImageView and 1 UIView.
Did I miss something here?
Update:
Screenshot of StoryBoard
For what it's worth, I tried this in a sample project with a bunch of subviews and it worked as expected.
#import "ViewController.h"
#interface ViewController ()
#end
#implementation ViewController
- (IBAction)printButtonTapped:(id)sender {
[self allSubviews:self.view];
}
- (void) allSubviews:(UIView*) parent {
NSLog(#"%#", parent);
for (UIView *child in parent.subviews) {
[self allSubviews:child];
}
}
#end
Console output is:
2015-09-13 22:06:00.904 RecursivePrint[66243:3455899] <UIView: 0x7fa902e0e6e0; frame = (0 0; 375 667); autoresize = W+H; layer = <CALayer: 0x7fa902e15030>>
2015-09-13 22:06:00.905 RecursivePrint[66243:3455899] <UIView: 0x7fa902e0e840; frame = (70 56; 452 337); autoresize = RM+BM; layer = <CALayer: 0x7fa902e15050>>
2015-09-13 22:06:00.905 RecursivePrint[66243:3455899] <UIView: 0x7fa902e24c90; frame = (31 33; 153 160); autoresize = RM+BM; layer = <CALayer: 0x7fa902e21f00>>
2015-09-13 22:06:00.906 RecursivePrint[66243:3455899] <UIView: 0x7fa902e24fc0; frame = (219 41; 153 160); autoresize = RM+BM; layer = <CALayer: 0x7fa902e1ec10>>
2015-09-13 22:06:00.906 RecursivePrint[66243:3455899] <UIButton: 0x7fa902d177e0; frame = (164.5 603; 46 30); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x7fa902d16c80>>
2015-09-13 22:06:00.907 RecursivePrint[66243:3455899] <UIButtonLabel: 0x7fa902d1f010; frame = (0 6; 46 18); text = 'Button'; alpha = 0.2; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fa902d1f670>>
2015-09-13 22:06:00.907 RecursivePrint[66243:3455899] <_UILayoutGuide: 0x7fa902e25ed0; frame = (0 0; 0 20); hidden = YES; layer = <CALayer: 0x7fa902e21b20>>
2015-09-13 22:06:00.907 RecursivePrint[66243:3455899] <_UILayoutGuide: 0x7fa902f77ec0; frame = (0 667; 0 0); hidden = YES; layer = <CALayer: 0x7fa902f09f70>>
As a side note, this is the first time in over a year that I've tried to do something in Objective-C. The Swift version seems so much easier to understand:
import UIKit
class ViewController: UIViewController {
#IBAction func printButtonTapped(sender: UIButton) {
printSubviews(self.view)
}
}
func printSubviews(parent:UIView) {
print(parent)
for child in parent.subviews {
printSubviews(child)
}
}
In addition, the Swift version of printSubviews is defined as a function, not a method so you don't call it from self, you just call it with the top level view you want to start with.
I have a UITextField in UITableViewCell. When user tries to enter some text into this textfield, app scrolls that cell to the top of UITableView.Here is the code:
#pragma mark - UITextField Delegates
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
UITableViewCell *QCELL = (UITableViewCell *)[[[[textField superview]superview]superview]superview];
UITableView *QTable = (UITableView *)[[QCELL superview] superview];
NSIndexPath*path = = [QTable indexPathForCell:QCELL];
return true;
}
and exception
2014-09-11 11:12:50.604 InspectTHIS[9401:348011] -[UIView indexPathForCell:]: unrecognized selector sent to instance 0x7c2e8b30
2014-09-11 11:12:50.608 InspectTHIS[9401:348011] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView indexPathForCell:]: unrecognized selector sent to instance 0x7c2e8b30'
Updated - Answered
After I search in Views Layer I found this
////////// iOS 8 //////////
<UIView: 0x792aabd0; frame = (0 0; 768 1023); opaque = NO; autoresize = W+H; layer = <CALayer: 0x792aac40>>
<UITableViewCellContentView: 0x79758340; frame = (0 0; 768 699); opaque = NO; gestureRecognizers = <NSArray: 0x79758530>; layer = <CALayer: 0x797583b0>>
<QuestionCell: 0x79757ed0; baseClass = UITableViewCell; frame = (0 0; 768 699); autoresize = W; layer = <CALayer: 0x79758190>>
<UITableViewWrapperView: 0x7967bc50; frame = (0 0; 768 750); gestureRecognizers = <NSArray: 0x7967bef0>; layer = <CALayer: 0x7967be30>; contentOffset: {0, 0}; contentSize: {768, 750}>
<UITableView: 0x78c99600; frame = (0 244; 768 750); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x7967b9c0>; layer = <CALayer: 0x7967ae00>; contentOffset: {0, 0}; contentSize: {768, 699}>
<UIView: 0x7967abd0; frame = (0 0; 768 1024); autoresize = RM+BM; layer = <CALayer: 0x7967ac40>>
//////// iOS 7 ////
<UIView: 0x11fbbbf0; frame = (0 0; 768 1023); opaque = NO; autoresize = W+H; layer = <CALayer: 0x11fbbc50>>
<UITableViewCellContentView: 0x11f832a0; frame = (0 0; 768 699); opaque = NO; gestureRecognizers = <NSArray: 0x11f8dd40>; layer = <CALayer: 0x11faa6f0>>
<UITableViewCellScrollView: 0x11fc4090; frame = (0 0; 768 699); autoresize = W+H; gestureRecognizers = <NSArray: 0x11f9c830>; layer = <CALayer: 0x11f978f0>; contentOffset: {0, 0}>
<QuestionCell: 0x11fa2090; baseClass = UITableViewCell; frame = (0 0; 768 699); autoresize = W; layer = <CALayer: 0x11fa1c90>>
<UITableViewWrapperView: 0xced1860; frame = (0 0; 768 750); autoresize = W+H; layer = <CALayer: 0xced18d0>>
<UITableView: 0xd958800; frame = (0 244; 768 750); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0xced1560>; layer = <CALayer: 0xced0eb0>; contentOffset: {0, 0}>
<UIView: 0xced0c30; frame = (0 0; 768 1024); autoresize = RM+BM; layer = <CALayer: 0xced0c90>>
as you can see in iOS 8, UITableViewCellScrollView is missing and and I can't go up like I did in iOS 7. so i change the code like this.
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
NSIndexPath*path;
UITableView *QTable;
CGFloat version =[[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 7.0)
{
UITableViewCell *QCELL = (UITableViewCell *)[[[[textField superview]superview]superview]superview];
QTable = (UITableView *)[[QCELL superview] superview];
path = [QTable indexPathForCell:QCELL];
}
else if(version >= 8.0)
{
UITableViewCell *QCELL = (UITableViewCell *)[[[textField superview]superview]superview];
QTable = (UITableView *)[[QCELL superview] superview];
path = [QTable indexPathForCell:QCELL];
}
NSIndexPath*path = = [QTable indexPathForCell:QCELL];
return true;
}
I change your original code a little and came out with this:
I made this change because I had a problem when the version was 8 the if for the >= 7 was been fired. And I need the variables outside the if.
CGFloat version =[[[UIDevice currentDevice] systemVersion] floatValue];
UITableViewCell *cell;
UITableView *table;
if ((version > 7) && (version < 8))
{
UITableViewCell *cell = (UITableViewCell*)[[[sender superview] superview]superview];
table = (UITableView *)cell.superview.superview;
}
else if(version > 8)
{
UITableViewCell *cell = (UITableViewCell*)[[sender superview] superview];
table = (UITableView *)cell.superview.superview;
}
Similarly I had a button inside a UITableViewCell.This will work for you. Here buttonView means my UIButton instance
For iOS 8
UITableViewCell *cell = (UITableViewCell*)[buttonView superview];
gave me the UITableViewCell instance
and for iOS 7 as usual
UITableViewCell *cell = [buttonView superview]superview];
gave me the UITableViewCell instance
And the
[QTable indexPathForCell:cell];
Will give you the NSIndexPath(This part is ok in the given answer).
This is what you get for traversing the view hierarchy instead of using delegate methods from the cell itself.
Make the Cell itself respond to the delegate of the textview. Let the cell have it's own protocol (delegate methods), and let your TableViewController be it's delegate.
Then your code in the subclassed UITableViewCell-class will look something like this:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
[self.delegate textFieldDidBeginEditingForCell:self];
return true;
}
Then in your TableViewController:
- (void)textFieldDidBeginEditingForCell:(YourCustomCell*)cell
{
NSIndexPath *path = [QTable indexPathForCell:cell];
...
}
I add objects in UIScrollView inside cycle FOR, but after the second interaction the index of subviews change.
When i create the ScrollView:
scroll.subviews :(
"<UIImageView: 0x147aeee0; frame = (1017 186; 7 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x147aef50>>",
"<UIImageView: 0x147aefa0; frame = (1019 184; 5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x147af010>>"
)
After i have the cycle FOR with [scroll addSubview:btn];
First
scroll.subviews :(
"<UIImageView: 0x147aeee0; frame = (1017 186; 7 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x147aef50>>",
"<UIImageView: 0x147aefa0; frame = (1019 184; 5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x147af010>>",
"<ContentButton: 0x13fdc610; baseClass = UIButton; frame = (15 10; 221 173); opaque = NO; tag = 1; layer = <CALayer: 0x1034cc00>>"
)
Second (change last object to index 0)
scroll.subviews :(
"<ContentButton: 0x13fdc610; baseClass = UIButton; frame = (15 10; 221 173); opaque = NO; tag = 1; layer = <CALayer: 0x1034cc00>>",
"<UIImageView: 0x147aefa0; frame = (1019 184; 5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x147af010>>",
"<UIImageView: 0x147aeee0; frame = (1017 186; 7 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x147aef50>>",
"<ContentButton: 0x105ddf70; baseClass = UIButton; frame = (246 10; 221 173); opaque = NO; tag = 149; layer = <CALayer: 0x105523e0>>"
)
Third and so on, the object will add normally (in last index)
scroll.subviews :(
"<ContentButton: 0x13fdc610; baseClass = UIButton; frame = (15 10; 221 173); opaque = NO; tag = 1; layer = <CALayer: 0x1034cc00>>",
"<UIImageView: 0x147aefa0; frame = (1019 184; 5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x147af010>>",
"<UIImageView: 0x147aeee0; frame = (1017 186; 7 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x147aef50>>",
"<ContentButton: 0x105ddf70; baseClass = UIButton; frame = (246 10; 221 173); opaque = NO; tag = 149; layer = <CALayer: 0x105523e0>>",
"<ContentButton: 0x13f1dc80; baseClass = UIButton; frame = (477 10; 221 173); opaque = NO; tag = 3; layer = <CALayer: 0x13f1dd20>>"
)
The problem is in the second interaction, so why the last object (ContentButton) was in the index 2 and change into index 0?
for (obj * objScroll in arrayChaObj)
{
// UIButton
ContentButton * btn = [[ContentButton alloc] initWithFrame:CGRectMake(btContentPosXChaObj,
10,
imgButtonScroll.size.width,
imgButtonScroll.size.height)];
btContentPosXChaObj += 10 + imgButtonScroll.size.width;
[scroll addSubview:btn];
NSLog(#"scroll.subviews :%#",scroll.subviews);
[scroll setContentSize:CGSizeMake(btContentPosXChaObj, imgButtonScroll.size.height+10)];
}
This is just a wild guess.
What happens when you call setContentSize: for the first time? Well, the two image views end up outside the content region. They won't be ever displayed.
I guess the scrollview then optimizes the order of subviews and puts the invisible ones to the end which can probably improve its clipping (redrawing) functionality.
Currently I don't have the time to check this and experiment but it's a reasonable explanation for me.
I just want to grab the button tag 1~ 5 in ScrollView, other data do not need to grasp
(void)layoutScrollImages
{
UIImageView *view = nil;
NSArray *subviews = [weekscroll subviews];
CGFloat curXLoc = 0;
for (view in subviews)
{
if ([view isKindOfClass:[UIImageView class]] && view.tag > 0)
{
NSLog(#"%d",view.tag);
CGRect frame = view.frame;
frame.origin = CGPointMake(curXLoc, 0);
view.frame = frame;
curXLoc += (wScrollObjWidth);
}
}
NSLog(#"subviews = %#",subviews);
[weekscroll setContentSize:CGSizeMake((wNumImages * wScrollObjWidth), [weekscroll bounds].size.height)];
}
subviews = (
"<UIImageView: 0x1ba330; frame = (313 61; 7 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x1bac00>>",
"<UIImageView: 0x1bc900; frame = (315 59; 5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x1bdde0>>",
"<UIButton: 0x1bd380; frame = (0 1; 50 66); opaque = NO; layer = <CALayer: 0x1bd410>>",
"<UIButton: 0x1bd690; frame = (50 0; 50 66); opaque = NO; layer = <CALayer: 0x1bd720>>",
"<UIButton: 0x1bd9a0; frame = (100 0; 50 66); opaque = NO; layer = <CALayer: 0x1bda30>>",
"<UIButton: 0x1bc570; frame = (150 0; 50 66); opaque = NO; layer = <CALayer: 0x1bc600>>",
"<UIButton: 0x1beaa0; frame = (300 0; 50 66); opaque = NO; tag = 1; layer = <CALayer: 0x1beb30>>",
"<UIButton: 0x1bff40; frame = (350 0; 50 66); opaque = NO; tag = 2; layer = <CALayer: 0x1c0920>>",
"<UIButton: 0x1c0e60; frame = (400 0; 50 66); opaque = NO; tag = 3; layer = <CALayer: 0x1c0ef0>>",
"<UIButton: 0x1c1430; frame = (450 0; 50 66); opaque = NO; tag = 4; layer = <CALayer: 0x1c14c0>>",
"<UIButton: 0x1c1a00; frame = (500 0; 50 66); opaque = NO; tag = 5; layer = <CALayer: 0x1c1a90>>",
"<UIButton: 0x1cb340; frame = (1800 0; 50 66); opaque = NO; layer = <CALayer: 0x1cb3d0>>",
"
)UIImageView: 0x1ba330; frame = (313 61; 7 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer =
As per printed log, only UIButtons are having tags and in sample code you are working on UIImageView, so use given code as per your requirement.
I have modified your code as below, just check it out.
for (id objView in subviews)
{
if ([objView isKindOfClass:[UIImageView class]])
{
UIImageView *imgView = (UIImageView*) objView;
if (imgView.tag > 0)
{
NSLog(#"%d",imgView.tag);
CGRect frame = imgView.frame;
frame.origin = CGPointMake(curXLoc, 0);
imgView.frame = frame;
curXLoc += (wScrollObjWidth);
}
}
}
Or if you want to grab only UIButtons,
for (UIButton *btnView in subviews)
{
if ([btnView isKindOfClass:[UIButton class]] && btnView.tag > 0)
{
NSLog(#"%d",btnView.tag);
CGRect frame = btnView.frame;
frame.origin = CGPointMake(curXLoc, 0);
btnView.frame = frame;
curXLoc += (wScrollObjWidth);
}
}
You want the button with tags greater than 0 right.. then why are you checking for [UIImageView class].. ?
your condition to find Buttons with tag greater than 0 should be :
if ([aView isKindOfClass:[UIButton class] && (aView.tag > 0)]) {
}
This question has been re-written, since I think it has more to do with views and layers than the original 'Finding the center of a tableview'. Also in hope of finding another answer.
In question, is a set of 4 views to show activity, in a tableview, in a tab bar.
The code of:
NSLog(#"view.center: %#", self.view.center);
NSLog(#"view.frame: %#", self.view.frame);
Produces, on first display of 'loading':
view.center: {160, 250}
view.frame: {{0, 20}, {320, 460}}
For 2nd (and subsequent) displays: (after a pop up date picker)
view.center: {160, 205.5}
view.frame: {{0, 0}, {320, 411}}
Self (ListViewController) is subclass of UITableViewController. So, the height of the view (or tableview) frame is changing. Why?
I've been exploring and found this info in the debugger, that seems relevant.
--- Before ---
[self parentViewController]:
<UITabBarController: 0x6e115a0>
[[self parentViewController] view]:
<UILayoutContainerView: 0x6e1b750; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x6e0c8f0>>
self: <ListsViewController: 0x6e13730>
[self tableView]:
<UITableView: 0x71e4000; frame = (0 20; 320 460); clipsToBounds = YES; opaque = NO; autoresize = W+H; layer = <CALayer: 0x6834db0>; contentOffset: {0, 0}>
[[self view] subviews]: (array)
<UIImageView: 0x6825e30; frame = (0 453; 320 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x6835a90>>,
<UIImageView: 0x68314e0; frame = (313 411; 7 20); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x683d120>>,
<UIView: 0x6a054f0; frame = (0 0; 320 460); alpha = 0.4; tag = 12; layer = <CALayer: 0x6a07840>>,
<UIView: 0x6a04c60; frame = (110 155.5; 100 100); alpha = 0.6; tag = 13; layer = <CALayer: 0x6a073c0>>,
<UILabel: 0x6a07480; frame = (110 200.5; 100 50); text = 'Loading ...'; clipsToBounds = YES; userInteractionEnabled = NO; tag = 14; layer = <CALayer: 0x6a065b0>>,
<UIActivityIndicatorView: 0x6a07a80; frame = (140 167.5; 40 40); tag = 15; layer = <CALayer: 0x6a07b40>>
--- After datepicker ---
[self parentViewController]:
<UITabBarController: 0x6e115a0>
[self parentViewController] view]:
<UILayoutContainerView: 0x6e1b750; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x6e0c8f0>>
self: <ListsViewController: 0x6e13730>
[self tableView]:
<UITableView: 0x71e4000; frame = (0 0; 320 411); clipsToBounds = YES; opaque = NO; autoresize = W+H; layer = <CALayer: 0x6834db0>; contentOffset: {0, 0}>
[[self view] subviews]:
<DetailTableViewCell: 0xb642120; baseClass = UITableViewCell; frame = (0 369; 320 44); autoresize = W; layer = <CALayer: 0xb642230>>,
<DetailTableViewCell: 0xb643850; baseClass = UITableViewCell; frame = (0 325; 320 44); autoresize = W; layer = <CALayer: 0xb643960>>,
<DetailTableViewCell: 0xb6435c0; baseClass = UITableViewCell; frame = (0 281; 320 44); autoresize = W; layer = <CALayer: 0xb6436d0>>,
<DetailTableViewCell: 0xb63cf30; baseClass = UITableViewCell; frame = (0 237; 320 44); autoresize = W; layer = <CALayer: 0xb63d130>>,
<DetailTableViewCell: 0x6a14050; baseClass = UITableViewCell; frame = (0 193; 320 44); autoresize = W; layer = <CALayer: 0x6a16fb0>>,
<DetailTableViewCell: 0x6a13760; baseClass = UITableViewCell; frame = (0 149; 320 44); autoresize = W; layer = <CALayer: 0x6a13870>>,
<DetailTableViewCell: 0x6a10920; baseClass = UITableViewCell; frame = (0 105; 320 44); autoresize = W; layer = <CALayer: 0x6a10010>>,
<DetailTableViewCell: 0xb63ce20; baseClass = UITableViewCell; frame = (0 60; 320 45); autoresize = W; layer = <CALayer: 0xb63c3e0>>,
<UIImageView: 0x6825e30; frame = (0 404; 320 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x6835a90>>,
<UIView: 0xb6477f0; frame = (0 0; 320 60); autoresize = W; layer = <CALayer: 0xb647820>>,
<UIImageView: 0x68314e0; frame = (313 411; 7 20); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x683d120>>,
<UIView: 0x6a098a0; frame = (0 0; 320 411); alpha = 0; tag = 9; animations = { opacity <CABasicAnimation: 0xb6279f0>; }; layer = <CALayer: 0x6a154b0>>,
<UIDatePicker: 0x6a23350; frame = (0 455; 320 216); tag = 10; animations = { position <CABasicAnimation: 0xb63bd40>; }; layer = <CALayer: 0x6a20590>>,
<UIToolbar: 0x6843f60; frame = (0 411; 320 44); opaque = NO; tag = 11; animations = { position=<CABasicAnimation: 0xb645f80>; }; layer = <CALayer: 0x6844a20>>,
<UIView: 0xb60baa0; frame = (0 0; 320 411); alpha = 0.4; tag = 12; layer = <CALayer: 0xb626af0>>,
<UIView: 0xb626b20; frame = (110 155.5; 100 100); alpha = 0.6; tag = 13; layer = <CALayer: 0xb626930>>,
<UILabel: 0xb60cfb0; frame = (110 200.5; 100 50); text = 'Loading ...'; clipsToBounds = YES; userInteractionEnabled = NO; tag = 14; layer = <CALayer: 0xb60d020>>,
<UIActivityIndicatorView: 0xb649e20; frame = (140 167.5; 40 40); tag = 15; layer = <CALayer: 0xb626960>>
You can use tableview.frame to access the origin points and it's dimensions. You can use tablview.center which is a CGPoint which gives you the center point of the object.