{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2928","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2928/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2928/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2928/events","html_url":"https://github.com/NativeScript/NativeScript/issues/2928","id":183990120,"number":2928,"title":"Cannot get nativeView from N view (iOS)","user":{"login":"alexrainman","id":3793554,"avatar_url":"https://avatars.githubusercontent.com/u/3793554?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrainman","html_url":"https://github.com/alexrainman","followers_url":"https://api.github.com/users/alexrainman/followers","following_url":"https://api.github.com/users/alexrainman/following{/other_user}","gists_url":"https://api.github.com/users/alexrainman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrainman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrainman/subscriptions","organizations_url":"https://api.github.com/users/alexrainman/orgs","repos_url":"https://api.github.com/users/alexrainman/repos","events_url":"https://api.github.com/users/alexrainman/events{/privacy}","received_events_url":"https://api.github.com/users/alexrainman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/iOS","name":"iOS","color":"fbca04"},{"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/T:Question","name":"T:Question","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-10-19T15:10:04Z","updated_at":"2016-10-24T14:02:19Z","closed_at":"2016-10-24T13:59:44Z","body":"I am loading a {N} view from a file using Loader:\r\n\r\n```\r\nvar view = builder.load({\r\n    path: \"~/Views/Slides\",\r\n    name: \"slider-view\"\r\n});\r\n```\r\n\r\nThen i need to convert this view to UIView to add it programmatically to another UIView:\r\n\r\n```\r\nvar obj = <any>view;\r\nobj._onAttached();\r\nviewController.view = obj.ios;\r\n```\r\n\r\nDoing some debugging i can see that obj._subViews contains the {N} UI elements but i get a white screen.\r\n\r\nIt seems obj.ios, obj._view and obj._nativeView are null at this point.\r\n\r\nAny ideas?\r\n\r\nI am using the same in Android and it works with the difference that in android i am passing context to _onAttached.\r\n\r\n```\r\nobj._onAttached(application.android.currentContext);\r\ncontainer.addView(obj.android);\r\n```\r\n\r\nIn this case obj.android contains the native view.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/255749078","html_url":"https://github.com/NativeScript/NativeScript/issues/2928#issuecomment-255749078","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2928","id":255749078,"user":{"login":"alexrainman","id":3793554,"avatar_url":"https://avatars.githubusercontent.com/u/3793554?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrainman","html_url":"https://github.com/alexrainman","followers_url":"https://api.github.com/users/alexrainman/followers","following_url":"https://api.github.com/users/alexrainman/following{/other_user}","gists_url":"https://api.github.com/users/alexrainman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrainman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrainman/subscriptions","organizations_url":"https://api.github.com/users/alexrainman/orgs","repos_url":"https://api.github.com/users/alexrainman/repos","events_url":"https://api.github.com/users/alexrainman/events{/privacy}","received_events_url":"https://api.github.com/users/alexrainman/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T14:02:19Z","updated_at":"2016-10-24T14:02:19Z","body":"@hshristov @tzraikov thanks for your support."}}
{"actor":{"display_login":"alexrainman"}}