Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15087] iOS7: Method Cache Corrupted

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-10-02T21:54:30.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 20, 2013 Sprint 20 API
ComponentsiOS
Labelsios7, mobilesdk, triage
ReporterNikhil N
AssigneeSabil Rahim
Created2013-09-08T06:36:13.000+0000
Updated2017-03-21T22:33:31.000+0000

Description

PROBLEM DESCRIPTION

Upon opening a window which includes a webView the following errors are seen in the console and the app crashes.

LOG

[DEBUG] objc[35284]: Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else.
[DEBUG] objc[35284]: receiver 0xe592b10, SEL 0x43d3643, isa 0xf2f4a8, cache 0xf2f4b0, buckets 0xe9e74b, mask 0xb, occupied 0x0
[DEBUG] objc[35284]: receiver 32 bytes, buckets 0 bytes
[DEBUG] objc[35284]: selector 'release'
[DEBUG] objc[35284]: isa ''
[DEBUG] objc[35284]: Method cache corrupted.

TESTCASE

Here's the webview.js file
    var win = Ti.UI.createWindow();

    win.orientationModes= [Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT,Ti.UI.PORTRAIT,Ti.UI.UPSIDE_PORTRAIT];

	var web = Ti.UI.createWebView({
		url: url,
		width: Ti.UI.FILL,
		height: Ti.UI.FILL,
		top: 0,
		left: 0
	});

		web.addEventListener('load', function() {
			win.setTitle(web.evalJS('document.title'));
		});

		web.addEventListener('error', function(e) {
			if(e.errorCode== -1003 || e.error == -1000 || e.error == -1006) al.add("That's one bad URL.");
			else alert(e.message)
		});

	win.add(web);

    return win;
The above is wrapped inside a module.exports. The calling window grabs the returned win object, and opens it as a child window in the active tab of a Tab Group.

Comments

  1. Ingo Muschenetz 2013-09-09

    Is this specifically an iOS 7 issue, or does it occur on previous versions?
  2. Ingo Muschenetz 2013-09-10

    Initial read by Sabil and Blain is that this is not a bug of ours, and not something to be immediately concerned with.
  3. Nikhil N 2013-09-10

    This doesn't seem to happen on iOS 6 (still using the aforementioned TiSDK). Although, I've narrowed this down further. If the url assigned to the webview is invalid (eg. not a valid NSURL), the above errors are thrown and the application crashes instantly.
  4. Sabil Rahim 2013-10-02

    This issue likely is a apple bug. I could not reproduce the issue with the invalid URL code used in testing.
       var win = Ti.UI.createWindow();
        
       win.orientationModes= [Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT,Ti.UI.PORTRAIT,Ti.UI.UPSIDE_PORTRAIT];
        
       var web = Ti.UI.createWebView({
           url: "http://asdfasd.cc",
           width: Ti.UI.FILL,
           height: Ti.UI.FILL,
           top: 0,
           left: 0
       });
        
           web.addEventListener('load', function() {
               win.setTitle(web.evalJS('document.title'));
           });
        
           web.addEventListener('error', function(e) {
               if(e.errorCode== -1003 || e.error == -1000 || e.error == -1006) alert("That's one bad URL.");
               else alert(e.message)
           });
        
       win.add(web);
        
       win.open();
       
  5. Sabil Rahim 2013-10-02

    Unless we have a better reproducible test case, it would be hard for us to narrow down the bug here. with the testing that i have done. I cannot reproduce this issue.
  6. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source