Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Can't build and deploy to iPhone - TiUIViewProxy undeclared

I'm using Titanium 1.2.1, and iPhone SDK 3.1.3 and when I launch the Simulator, my app works just fine. When I switch to the "Run on Device" tab, I am again using SDK 3.1.3, and have specified my development certificate and provisioning profile for this app (whose id matches my project's application ID). When I click "Install Now", I get a message that says "Install Error" and to see the log for more details.

So I tried to build and run it on my actual iPhone via the generated XCode project, and I get three compile errors:

…/TiUITableView.m:464: error: 'TiUIViewProxy' undeclared (first use in this function)
…/TiUITableView.m:464: error: (Each undeclared identifier is reported only once
…/TiUITableView.m:464: error: for each function it appears in.)
…/TiUITableView.m:464: error: expected expression before ')' token
…/TiUITableView.m:471: error: expected expression before ')' token

Here is the Objective-C function, starting with line 454:

-(void)setBounds:(CGRect)bounds
{
    [super setBounds:bounds];

    // Since the header proxy is not properly attached to a view proxy in the _runsignup
    // system, we have to reposition it here.  Resetting the table header view
    // is because there's a charming bug in UITableView that doesn't respect redisplay
    // for headers/footers when the frame changes.
    UIView* headerView = [[self tableView] tableHeaderView];
    if ([headerView isKindOfClass:[TiUIView class]]) {
        [(TiUIViewProxy*)[(TiUIView*)headerView proxy] reposition];
        [[self tableView] setTableHeaderView:headerView];
    }

    // ... And we have to do the same thing for the footer.
    UIView* footerView = [[self tableView] tableFooterView];
    if ([footerView isKindOfClass:[TiUIView class]]) {
        [(TiUIViewProxy*)[(TiUIView*)footerView proxy] reposition];
        [[self tableView] setTableFooterView:footerView];
    }
}

Here is the original Javascript code, related to the tableview that I suspect is causing the problem:

var win = Titanium.UI.currentWindow;

var raceData = [
    {name:'Ben Franklin 5k', city:'Philadelphia', state:'PA', date:'June 30, 2010'},
    {name:'John Adams 5k', city:'Boston', state:'MA', date:'July 6, 2010'},
    {name:'Memory Walk 5k', city:'Atlantic City', state:'NJ', date:'August 15, 2010'}
];

var tableView;
var data = [];

// create the race rows
for (var i = 0; i < raceData.length; i++)
{
    var row = Titanium.UI.createTableViewRow();
//    row.selectedBackgroundColor = '#fff';
//    row.backgroundColor = '#ffffff';
    row.touchEnabled = false;
    row.height = 110;
    row.className = 'datarow';
    row.clickName = 'row';

    var user = Titanium.UI.createLabel({
        color:'#576996',
        font:{fontSize:16,fontWeight:'bold', fontFamily:'Arial'},
        left:10,
        top:2,
        height:30,
        width:400,
        clickName:'name',
        text:raceData[i].name + ' - ' + raceData[i].city + ', ' + raceData[i].state
    });
    row.add(user);

    var fontSize = 16;
    var date = Titanium.UI.createLabel({
        color:'#222',
        font:{fontSize:fontSize,fontWeight:'normal', fontFamily:'Arial'},
        left:10,
        top:25,
        height:30,
        width:200,
        clickName:'comment',
        text:raceData[i].date
    });
    row.add(date);

    var btnTimeRace = Titanium.UI.createButton({
//        backgroundColor:'#0000ff',
//        borderColor:'#f00',
//        color:'#ffffff',
        title:'Time Race',
        height:40,
        width:145,
        left:10,
        top:60
    });
    row.add(btnTimeRace);

    var btnScanBibs = Titanium.UI.createButton({
//        backgroundColor:'#00f',
//        borderColor:'#f00',
//        color:'#fff',
        title:'Scan Bibs',
        height:40,
        width:145,
        left:165,
        top:60
    });
    row.add(btnScanBibs);

    data.push(row);
}

tableView = Titanium.UI.createTableView({
    data:data
//    filterAttribute:'filter',
//    backgroundColor:'white'
});

win.add(tableView);

Any help would be greatly appreciated.

— asked May 31st 2010 by Brian Robinson
  • 3.1.3
  • iphone
0 Comments

3 Answers

  • Accepted Answer

    This is a known issue that was fixed in head (for 1.4) about 2 weeks ago. Sorry about that.

    The work around is easy.

    Edit the TiUIViewProxy.h and TiUIViewProxy.m and remove the #ifdef TI_UI_VIEWPROXY and the #endif from the bottom of both files.

    — answered May 31st 2010 by Jeff Haynie
    permalink
    0 Comments
  • That worked. Thanks so much!

    — answered May 31st 2010 by Brian Robinson
    permalink
    0 Comments
  • What a fucking shit is TItanium! No solutions in anywhere. Thanks

    — answered June 9th 2012 by Alberto Velaz
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.