What does autoresize = RM+BM mean? - ios

I get this when using the Xcode debugging console with this line:
po [[UIWindow keyWindow] recursiveDescription]
Then I get back lines with the recursive description like this
<UILabel: 0xb0b8170; frame = (138 106; 200 15); text = 'Distance'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0xb0b8220>>
What does "autoresize = RM+BM" and is there a place I can lookup the meaning of the letters? I also saw something like this "autoresize = LM+W+RM+TM+H+BM".

autoresize indicates which bits have been set in the autoresizingMask:
RM = UIAutoresizingFlexibleRightMargin
BM = UIAutoresizingFlexibleBottomMargin
The others follow a similar abbreviation syntax.

If you give all the constraints, then you can easily see all of them. These all indicates the UIAutoResizing.
RM means Right margin
BM means Bottom margin
W means Width
H means Height
LM means Left margin
TM means Top margin

<SIGMAPOINT_MPAdView: 0x10db888a0; frame = (0 0; 320 50); clipsToBounds = YES; autoresize = LM+RM; layer = <CALayer: 0x282b704c0>>

Related

How to view the content UITableView's reusable pool

I was trying to deep dive into how the UITableView works internally. I've already read multiple posts regarding that like,
https://www.mikeash.com/pyblog/friday-qa-2013-02-22-lets-build-uitableview.html
I want to know if there is any way we can look into the content of the reusable pool, i.e. how many and what all UITableViewCell types are available inside it at a moment.
I already know that we'll have the cells as per the screen size and the cell height. But I'm trying to figure out what happens if the tableView accepts different types of cells at different indexPaths.
Well, you can dig down into the objects in debug...
I set a breakpoint in didSelectRowAt and looked into the Variables View pane:
I had one row (index path [0,3] that used TestCellB and 90 rows that used TestCell, and the table was scrolled to row 21 (so row [0,3] was well off-screen.
As you can see, there is an internal Dictionary named _reusableTableCells which, in my example, currently contains 1 TestCellB and 2 TestCells.
EDIT
I just gave this a try - might give you some additional info:
var reusableCells = tableView.value(forKey: "_reusableTableCells")
print(reusableCells)
Output:
Optional({
TestCellB = (
"<TranslateTest.TestCellB: 0x7f87b206aa00; baseClass = UITableViewCell; frame = (0 1612; 414 37); clipsToBounds = YES; hidden = YES; autoresize = W; layer = <CALayer: 0x600003a66380>>"
);
TestCellC = (
"<TranslateTest.TestCellC: 0x7f87b2894800; baseClass = UITableViewCell; frame = (0 205; 414 93); clipsToBounds = YES; hidden = YES; autoresize = W; layer = <CALayer: 0x600003a586e0>>",
"<TranslateTest.TestCellC: 0x7f87b3000e00; baseClass = UITableViewCell; frame = (0 298; 414 93); clipsToBounds = YES; hidden = YES; autoresize = W; layer = <CALayer: 0x600003a5fe40>>"
);
})

iOS Extension does not display image in UIImageView

I found this good link how to get selected images.
I am trying to set image that I get from extension context to image view that I placed in storyboard.
this my print out code po self.theImageView:
<UIImageView: 0x7b8a1c90; frame = (240 89; 52 41); opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7b887fa0>> - (null)
and this is po self.theImageView.image
<UIImage: 0x7a6977f0>
So I even can see image using eye tool when debug it:
But on the screen of my simulator there is no visible image.

Could not find layout engine view for view's -Interface Builder Cocoa Touch Tool

I am a xamarin developer, I am using visual studio xamarin and using a virtual MAC machine in my windows machine for build and deployment. Today I have updated the Xamarin to Xamarin 3.
Now I am facing an issue.
I am able connect Xamarin iOS Build Host.
But the issue is, when I try to run the application, I am getting “deployment errors” message.
Error description is as follows.
1>Build server returned an Error.
1>2014-05-29 15:12:31.338 Interface Builder Cocoa Touch Tool[367:303]
1>WARNING:
1>Reason: Could not find layout engine view for view's (<UILabel: 0x18ec1b90; frame = (5 0; 20 20); text = '31'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x18eafcd0>>) coordinate space view <UIView: 0xb6515a0; frame = (0 0; 50 65); autoresize = W+H; gestureRecognizers = <NSArray: 0x18ee7ca0>; layer = <CALayer: 0x18ec9cd0>>. But the canvas coordinateSpaceView is view's superview, so we are assuming the same in the layout engine.
1>File: /SourceCache/IBAutolayoutFoundationIOS/IBAutolayoutFoundation-3430/Framework/Classes/Arbitration/IBAutolayoutEngine.m:335
1>Method: -[IBAutolayoutEngine layoutFrameForView:inCoordinateSpaceOfView:]
Please let me know ,if you have any idea regarding this issue..

How to display page scrubber with QLPreviewController in a subview

I am embedding a QLPreviewController in my own view controller by adding it as a child view controller like this (contentArea is a UIView property that determines which part of the screen the preview should use):
QLPreviewController* preview = [[QLPreviewController alloc] init];
preview.dataSource = self;
preview.delegate = self;
[self addChildViewController:preview];
CGFloat w = self.contentArea.frame.size.width;
CGFloat h = self.contentArea.frame.size.height;
preview.view.frame = CGRectMake(0, 0,w, h);
[self.contentArea addSubview:preview.view];
[preview didMoveToParentViewController:self];
self.qlPreviewController = preview;
This works so far. However, when I open a PDF, I do not get the page scrubber that is shown on the right side when the QLPreviewController is shown full screen (see screenshot).
Using DCIntrospect I see that there is a special subview of type QLScrubView responsible for this:
...
| <QLScrubView: 0x1274e990; frame = (963 64; 61 704); autoresize = LM+H; layer = <CALayer: 0x1274eb30>>
| | <QLThumbnailView: 0x11fc6460; frame = (17 329; 32 45); layer = <CALayer: 0x11fcb4b0>>
| | <QLThumbnailView: 0x11fd45a0; frame = (17 382; 32 45); layer = <CALayer: 0x11fbe830>>
| | <QLThumbnailView: 0x1274dae0; frame = (9 268; 48 61); layer = <CALayer: 0x1273b860>>
...
However, this scrub view is missing in the embedded use case.
Any ideas how to make this appear?
It displays automatically when you have more than one page. I would guess that there's something wrong with your PDF. Try other PDFs from other sources and see if you get the same problem. I use PDFs all the time and the scrubber shows up just fine.
My other thought is maybe resizing your preview controller is not behaving properly. Try loading the preview controller as a modal view controller (no parent) and see if the scrubber is still hidden.

Strange Table View Header issue when using Three20 TTTableViewController

I am building a TTTableViewController subclass based on Three20 TTCatalog sample. In there they have defined a subclass of TTTableViewController which has search functionality, called SearchTextController, and it has a search bar appear in the table view header.
Here's what their loadView method looks like:
- (void)loadView {
[super loadView];
TTTableViewController* searchController = [[[TTTableViewController alloc] init] autorelease];
searchController.dataSource = [[[MockSearchDataSource alloc] initWithDuration:1.5] autorelease];
self.searchViewController = searchController;
self.tableView.tableHeaderView = _searchController.searchBar;
}
I tried to re implement the same kind of functionality in my own subclass of TTTableView. The problem is that I cannot get the search bar to appear.
Running these in loadView of TTCatalog SearchTestController (after the last line)
NSLog(#"_searchController.searchBar address %#",_searchController.searchBar.description);
NSLog(#"self.tableView.tableHeaderView address %#",self.tableView.tableHeaderView.description);
yields the same memory address for the layer (meaning the view got set correctly)
2012-07-03 12:00:02.326 TTCatalog[53493:f803] _searchController.searchBar address <UISearchBar: 0x6a5c940; frame = (0 0; 320 44); layer = <CALayer: 0x6a5ca40>>
2012-07-03 12:00:02.327 TTCatalog[53493:f803] self.tableView.tableHeaderView address <UISearchBar: 0x6a5c940; frame = (0 0; 320 44); layer = <CALayer: 0x6a5ca40>>
When I run the same NSLogs in my app, I get this:
2012-07-03 11:41:54.900 myApp[51991:f803] _searchController.searchBar address <UISearchBar: 0x6a43c20; frame = (0 0; 320 44); layer = <CALayer: 0x6a43ce0>>
2012-07-03 11:41:54.901 myApp[51991:f803] self.tableView.tableHeaderView address <UISearchBar: 0x6a43c20; frame = (0 0; 320 44); layer = <CALayer: 0x6a43ce0>>
The layers have the same memory address in my app as well, but the search bar is not visible in the table view header. Is there something else I am missing here?

Resources