Guest User

Untitled

a guest
Jul 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function applicationDidFinishLaunching(self, application)
  2. local frame = UIScreen:mainScreen():bounds()
  3. self.window = UIWindow:initWithFrame(frame)
  4. self.window:setBackgroundColor(UIColor:orangeColor())
  5.  
  6.  
  7. local label = UILabel:initWithFrame(CGRect(0, 100, 320, 40))
  8. label:setFont(UIFont:boldSystemFontOfSize(30))
  9. label:setColor(UIColor:orangeColor())
  10. label:setText("Hello Lua!")
  11. label:setTextAlignment(UITextAlignmentCenter)
  12. self.window:addSubview(label)
  13.  
  14. self.window:makeKeyAndVisible()
  15. runString_debug(self,"for i=1,10 do print(i) end",1)
  16. print "DOES IT GET HERE?"
  17. end
  18.  
  19.  
  20. function runString_debug(self, s, d)
  21. local u,v=loadstring(s)
  22. if (v~=nil) then
  23. print(v)
  24. else
  25. if d==1 then
  26. local function callb()
  27. print("called callb")
  28. error()
  29. end
  30. debug.sethook(callb,"",50)
  31. end
  32.  
  33. print "DOES THE CODE EVER GET HERE?"
  34. local status, err=pcall(u)
  35. if (not status) then
  36. print(err)
  37. end
  38. end
  39. end
Add Comment
Please, Sign In to add comment