Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set the frame of a UIView at runtime using lldb expr (DEBUGGING Console)

I'm trying the following

(lldb) expr [_tvFeed setFrame:(CGRect)CGRectMake(0, 0, 320, 300)];

I'm getting

error: call to 'CGRectMake' is ambiguous
note: candidate function
note: candidate function
error: 1 errors parsing expression

I'm using XCode 6.1 , LLDB version lldb-320.4.152

like image 626
LolaRun Avatar asked Dec 17 '14 19:12

LolaRun


2 Answers

OK so here's a way that worked

expr CGRect rect; rect.origin.x=0; rect.origin.y=0; rect.size.width=320; rect.size.height=300; (void)[_tvFeed setFrame:rect];
like image 71
LolaRun Avatar answered Sep 18 '22 21:09

LolaRun


You can use C compound literals to create CGRect, cause it is just a C struct

It will look like this

(lldb) expr [_tvFeed setFrame:(CGRect){0, 0, 320, 300}];
like image 41
Peter K Avatar answered Sep 20 '22 21:09

Peter K